php-src/ext/opcache/tests/preload_method_static_vars.inc
Nikita Popov 670fe594b9 Fix static variable in methods inheritance during preloading
This is now "bug compatible" with the normal behavior, and more
imporantly, does not crash :)
2020-11-04 15:42:52 +01:00

16 lines
232 B
PHP

<?php
class Foo {
public static function test() {
static $i = 0;
var_dump(++$i);
}
}
Foo::test();
eval("class Bar extends Foo {}"); // Avoid early binding.
Foo::test();
Bar::test();
Bar::test();
echo "\n";