mirror of
https://github.com/php/php-src.git
synced 2024-12-12 11:23:53 +08:00
37f3425263
Fixes segfault on direct use, segfault on opcache evaluated use, leak on temporary use. Fixes analogeous segfault for ${42} on opcache eval as well.
44 lines
657 B
PHP
44 lines
657 B
PHP
--TEST--
|
|
Using an integer as a static property name
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
public static $bar = 42;
|
|
}
|
|
|
|
$n = 42;
|
|
|
|
${42} = 24;
|
|
var_dump(${42});
|
|
var_dump(${(int) 42});
|
|
var_dump(${(int) $n});
|
|
|
|
try {
|
|
var_dump(Foo::${42});
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
var_dump(Foo::${(int) 42});
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
var_dump(Foo::${(int) $n});
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(24)
|
|
int(24)
|
|
int(24)
|
|
Access to undeclared static property: Foo::$42
|
|
Access to undeclared static property: Foo::$42
|
|
Access to undeclared static property: Foo::$42
|
|
|