3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo($text = "Bar") { echo $text; } // Pass the function to the array. Do not use () here. $array = array( 'func' => foo ); // And call it. $array['func'](); // Outputs: "Bar" $array['func']("Foo Bar"); // Outputs: "Foo Bar"
Output for 7.0.0 - 7.1.0
Notice: Use of undefined constant foo - assumed 'foo' in /in/Uhari on line 9 BarFoo Bar
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.6.28
Notice: Use of undefined constant foo - assumed 'foo' in /in/Uhari on line 10 BarFoo Bar
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Uhari on line 14
Process exited with code 255.