summaryrefslogtreecommitdiff
path: root/Zend/tests/static_variable_in_dynamic_function.phpt
blob: 77b71a48831f045b7d1d563fe0736436072f8922 (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 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)