I was working with pthreads in PHP and noticed that pthreads loses object variables in its context, is this normal or a bug or I\'m doing something wrong ?
class
It's normal: https://gist.github.com/krakjoe/6437782
There is no point in me writing the relevant parts out again; you will benefit from reading the whole article.
TL;DR Resources are officially unsupported, coupled with how pthreads objects work, this leads to the behaviour you are experiencing.