mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
6f63e05320
This has been fixed by 0f2cdbf214
,
add the test case.
25 lines
393 B
PHP
25 lines
393 B
PHP
--TEST--
|
|
Bug #73816: Broken eval(anonymous class)
|
|
--FILE--
|
|
<?php
|
|
|
|
function anon()
|
|
{
|
|
static $i = 0;
|
|
return eval(sprintf('return new class { private $prop%s; };', ++$i));
|
|
}
|
|
|
|
var_dump(anon());
|
|
var_dump(anon());
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(class@anonymous)#1 (1) {
|
|
["prop1":"class@anonymous":private]=>
|
|
NULL
|
|
}
|
|
object(class@anonymous)#1 (1) {
|
|
["prop2":"class@anonymous":private]=>
|
|
NULL
|
|
}
|