3v4l.org

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