3v4l.org

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

preferences:
188.19 ms | 1399 KiB | 65 Q