php-src/ext/opcache/tests/optimize_static_002.phpt
2023-05-24 20:17:31 +02:00

23 lines
461 B
PHP

--TEST--
Keep BIND_STATIC when static variable has an initializer
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--EXTENSIONS--
opcache
--FILE--
<?php
function foo() {
// Eliminating this does have a small side effect of not showing & for $a when var_dumping static variables
static $a = 42;
var_dump((new ReflectionFunction(__FUNCTION__))->getStaticVariables());
}
foo();
?>
--EXPECT--
array(1) {
["a"]=>
int(42)
}