3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f($x) { echo $x; } $funs = array(); for ($i=0; $i<10; $i++) { $funs[] = f($i); } for ($i=0; $i<10; $i++) { $g = $funs[$i]; g(); }
Output for 7.0.0 - 7.1.0
0123456789 Fatal error: Uncaught Error: Call to undefined function g() in /in/09VlO:14 Stack trace: #0 {main} thrown in /in/09VlO on line 14
Process exited with code 255.
Output for 5.0.0 - 5.6.28
0123456789 Fatal error: Call to undefined function g() in /in/09VlO on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
0123456789 Fatal error: Call to undefined function: g() in /in/09VlO on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
0123456789 Fatal error: Call to undefined function: g() in /in/09VlO on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
0123456789 Fatal error: Call to undefined function: g() in /in/09VlO on line 14