summaryrefslogtreecommitdiff
path: root/Zend/tests/static_variable_in_dynamic_function_2.phpt
blob: f7c160325f5afa0bb84d3ca3c514d2d101eed11e (plain)
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 after dynamic def dtor)
--FILE--
<?php

$code = <<<'CODE'
if (1) {
    function test() {
        static $x = 0;
        var_dump(++$x);
    }
}
CODE;
eval($code);
test();
test();

?>
--EXPECT--
int(1)
int(2)