3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fn = function() { throw new Exception('test'); }; try { $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/VJmLA:9 Stack trace: #0 /in/VJmLA(9): ReflectionFunction->__construct('{closure}') #1 {main} thrown in /in/VJmLA on line 9
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/VJmLA:9 Stack trace: #0 /in/VJmLA(9): ReflectionFunction->__construct('{closure}') #1 {main} thrown in /in/VJmLA on line 9
Process exited with code 255.