3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { private $a = new stdClass(); function bar() { return $this->a; } } $foo = new Foo(); $b = $foo->bar(); $b->beep = 'boop'; $c = $foo->bar(); var_dump($c);
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/dZ05b on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_NEW in /in/dZ05b on line 4
Process exited with code 255.