FastCGI the dispatch thread resolves PHP, is the static property (memory) in PHP between threads shared? Because fastcgi runs a PHP script, the memory is not released, and then the next request is scheduled to be processed, then the value of the static variable stored after the PHP run, the next PHP will get it?
Such as
class A { public statis $var; public static function init() { $var+=1; } }A::init();
When the next PHP runtime A::init();
, is the value of $var 1 or 2?
Reply content:
FastCGI the dispatch thread resolves PHP, is the static property (memory) in PHP between threads shared? Because fastcgi runs a PHP script, the memory is not released, and then the next request is scheduled to be processed, then the value of the static variable stored after the PHP run, the next PHP will get it?
Such as
class A { public statis $var; public static function init() { $var+=1; } }A::init();
When the next PHP runtime A::init();
, is the value of $var 1 or 2?
If PHP is combined with nginx, it is a multi-process model through FPM management, and the process is unable to share memory. So, you know.