summaryrefslogtreecommitdiff
path: root/Zend/tests/bug73816.phpt
blob: aea392be5e1823d9b97bb0c7fa287b3677f13e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
}