3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class TestClass { public function baz() { echo "Worked!"; } } $foo = 'bam'; $bam = ['bar' => new TestClass()]; $$foo['bar']->baz(); function getResult() { return "string"; } echo getResult(){0};
based on 3DAXT
Output for 7.0.0 - 7.2.0
Worked!s
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '{', expecting ',' or ';' in /in/eW7s7 on line 19
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/eW7s7 on line 9
Process exited with code 255.