xref: /PHP-8.1/Zend/tests/method_static_var.phpt (revision 9a1da9f6)
1--TEST--
2Initial value of static var in method depends on the include time of the class definition
3--FILE--
4<?php
5
6class Foo {
7    public static function test() {
8        static $i = 0;
9        var_dump(++$i);
10    }
11}
12
13Foo::test();
14eval("class Bar extends Foo {}");
15Foo::test();
16
17Bar::test();
18Bar::test();
19?>
20--EXPECT--
21int(1)
22int(2)
23int(3)
24int(4)
25