3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test() { $s = ""; $f = function($count) use (&$s) { if ($count <= 0) { return; } else { $s = $s."x"; $f($count-1); } }; $f(2); return $s; } echo test();
Output for 7.0.0 - 7.3.0beta1
Notice: Undefined variable: f in /in/IKYbZ on line 6 Fatal error: Uncaught Error: Function name must be a string in /in/IKYbZ:6 Stack trace: #0 /in/IKYbZ(8): {closure}(2) #1 /in/IKYbZ(12): test() #2 {main} thrown in /in/IKYbZ on line 6
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: f in /in/IKYbZ on line 6 Fatal error: Uncaught Error: Function name must be a string in /in/IKYbZ:6 Stack trace: #0 /in/IKYbZ(8): Closure$test() #1 /in/IKYbZ(12): test() #2 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: f in /in/IKYbZ on line 6 Fatal error: Function name must be a string in /in/IKYbZ on line 6
Process exited with code 255.