3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fn() { throw new Exception('test'); } try { $fn = function() { fn(); }; $fn(); } catch (Exception $e) { foreach ($e->getTrace() as $frame) { $r = new ReflectionFunction($frame['function']); echo($r->isClosure()); } }
based on H4XrG
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught ReflectionException: Function {closure}() does not exist in /in/uL9UC:12 Stack trace: #0 /in/uL9UC(12): ReflectionFunction->__construct('{closure}') #1 {main} thrown in /in/uL9UC on line 12
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Function {closure}() does not exist' in /in/uL9UC:12 Stack trace: #0 /in/uL9UC(12): ReflectionFunction->__construct('{closure}') #1 {main} thrown in /in/uL9UC on line 12
Process exited with code 255.