1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
--TEST--
ReflectionMethod::getStaticVariables() should not bleed IS_TYPE_UNINITIALIZED
--FILE--
<?php
function test() {
echo "test() called\n";
return 42;
}
function foo() {
$methodInfo = new ReflectionFunction(__FUNCTION__);
$nullWithIsTypeUninitialized = $methodInfo->getStaticVariables()['a'];
static $a = test();
var_dump($a);
// Technically, IS_TYPE_UNINITIALIZED does bleed, but it doesn't matter since there's no way we
// can assign it to the static variable directly instead of the reference.
$staticVar = &$methodInfo->getStaticVariables()['a'];
$staticVar = $nullWithIsTypeUninitialized;
}
foo();
foo();
?>
--EXPECT--
test() called
int(42)
NULL
|