3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Wl\A; class B { public function get() { return "BBBBB"; } } class A { public function b(B $b) { print_r($b::get()); } } $a = new A(); $reflection = new \ReflectionFunction($closure); $arguments = $reflection->getParameters(); echo "ARGS:\n"; var_dump($arguments); exit; try { $a->b(""); } catch (\Exception $e) { echo "catched"; } catch (\TypeError $e) { echo "subidubi"; }
based on mjZma
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: closure in /in/LW4UO on line 18 Fatal error: Uncaught ReflectionException: Function () does not exist in /in/LW4UO:18 Stack trace: #0 /in/LW4UO(18): ReflectionFunction->__construct('') #1 {main} thrown in /in/LW4UO on line 18
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Notice: Undefined variable: closure in /in/LW4UO on line 18 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/LW4UO:18 Stack trace: #0 /in/LW4UO(18): ReflectionFunction->__construct('') #1 {main} thrown in /in/LW4UO on line 18
Process exited with code 255.