Skip to content

Commit 6f63e05

Browse files
committed
Add test for bug #73816
This has been fixed by 0f2cdbf, add the test case.
1 parent 3c2fcb7 commit 6f63e05

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Zend/tests/bug73816.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #73816: Broken eval(anonymous class)
3+
--FILE--
4+
<?php
5+
6+
function anon()
7+
{
8+
static $i = 0;
9+
return eval(sprintf('return new class { private $prop%s; };', ++$i));
10+
}
11+
12+
var_dump(anon());
13+
var_dump(anon());
14+
15+
?>
16+
--EXPECT--
17+
object(class@anonymous)#1 (1) {
18+
["prop1":"class@anonymous":private]=>
19+
NULL
20+
}
21+
object(class@anonymous)#1 (1) {
22+
["prop2":"class@anonymous":private]=>
23+
NULL
24+
}

0 commit comments

Comments
 (0)