I come from OO background and have done a 3 day crash course on PHP and now I try to find few issues in a relatively big PHP project and the problem I am getting seems to be very weird (at least in other OO languages)
So what I have is something like this:
class A
{
static $num = 0;
public static function instance($type, $options = array())
{
self::$num++;
// some more code here
}
}
and after few dozens of calls to this method $num value resets again to 0 and I wonder how is this possible? I know that in other languages like C# the lifetime of the static is the lifetime of the app. So what are potential reasons for static variable reset in PHP