3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $testing = 'foo'; $array = ['bar' => 'testing']; function test() { return 'testing'; } echo ${$array['bar']}; echo PHP_EOL; echo $$array['bar']; echo PHP_EOL; echo ${test()}; echo PHP_EOL; echo $test(); echo PHP_EOL;
based on JbMGC
Output for 7.0.0 - 7.3.0rc3
foo Notice: Array to string conversion in /in/DRIv8 on line 13 Notice: Undefined variable: Array in /in/DRIv8 on line 13 foo Notice: Undefined variable: test in /in/DRIv8 on line 17 Fatal error: Uncaught Error: Function name must be a string in /in/DRIv8:17 Stack trace: #0 {main} thrown in /in/DRIv8 on line 17
Process exited with code 255.
Output for hhvm-3.15.4
foo Notice: Array to string conversion in /in/DRIv8 on line 13 Notice: Undefined variable: Array in /in/DRIv8 on line 13 foo Notice: Undefined variable: test in /in/DRIv8 on line 17 Fatal error: Uncaught Error: Function name must be a string in /in/DRIv8:17 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
foo foo foo Notice: Undefined variable: test in /in/DRIv8 on line 17 Fatal error: Function name must be a string in /in/DRIv8 on line 17
Process exited with code 255.