mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
commit
0e6cff70a5
24
Zend/tests/bug73816.phpt
Normal file
24
Zend/tests/bug73816.phpt
Normal file
@ -0,0 +1,24 @@
|
||||
--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
|
||||
}
|
Loading…
Reference in New Issue
Block a user