php-src/Zend/tests/bug73816.phpt
Nikita Popov 6f63e05320 Add test for bug #73816
This has been fixed by 0f2cdbf214,
add the test case.
2020-01-03 11:26:31 +01:00

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
}