3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test ($callback) { return $callback(2, 13); }; $sum = function($a, $b) { return $a + $b; }; echo test('sum');
based on Q2bJe
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function sum() in /in/2YbIm:4 Stack trace: #0 /in/2YbIm(11): test('sum') #1 {main} thrown in /in/2YbIm on line 4
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Call to undefined function sum() in /in/2YbIm on line 4
Process exited with code 255.