3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Bar{ $prop = 2; } $foo = array( 'foo' => '', 'bar' => new Bar(), ); $bar = $foo; $barbar = $bar['bar']; $barbar->prop = 3; var_dump($foo, $bar);
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected '$prop' (T_VARIABLE), expecting function (T_FUNCTION) in /in/JOBh0 on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/JOBh0 on line 4
Process exited with code 255.