3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $testing = 'foo'; $array = ['bar' => 'testing']; function test() { return 'testing'; } class Test { public function output() { echo 'called'; } } $string = 'test'; $test = new Test(); echo ${$array['bar']}; echo PHP_EOL; echo $$array['bar']; echo PHP_EOL; echo ${test()}; echo PHP_EOL; echo $test(); echo PHP_EOL; echo ($$string)->output();
based on p5jE7
Output for 7.0.0 - 7.3.0rc3
foo Notice: Array to string conversion in /in/565cO on line 23 Notice: Undefined variable: Array in /in/565cO on line 23 foo Fatal error: Uncaught Error: Function name must be a string in /in/565cO:27 Stack trace: #0 {main} thrown in /in/565cO on line 27
Process exited with code 255.
Output for hhvm-3.15.4
foo Notice: Array to string conversion in /in/565cO on line 23 Notice: Undefined variable: Array in /in/565cO on line 23 foo Fatal error: Uncaught Error: Function name must be a string in /in/565cO:27 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in /in/565cO on line 29
Process exited with code 255.