1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
--TEST-- Static variables in dynamically declared function (first use before dynamic def dtor) --FILE-- <?php $code = <<<'CODE' if (1) { function test() { static $x = 0; var_dump(++$x); } test(); } CODE; eval($code); test(); ?> --EXPECT-- int(1) int(2)