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 DRIv8
Output for 7.0.0 - 7.2.8
foo Notice: Array to string conversion in /in/davG9 on line 23 Notice: Undefined variable: Array in /in/davG9 on line 23 foo Fatal error: Uncaught Error: Function name must be a string in /in/davG9:27 Stack trace: #0 {main} thrown in /in/davG9 on line 27
Process exited with code 255.
Output for hhvm-3.15.4
foo Notice: Array to string conversion in /in/davG9 on line 23 Notice: Undefined variable: Array in /in/davG9 on line 23 foo Fatal error: Uncaught Error: Function name must be a string in /in/davG9:27 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
foo foo foo Fatal error: Function name must be a string in /in/davG9 on line 27
Process exited with code 255.