3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Wl\A; class B { public function get() { return "BBBBB"; } } $b = new B(); $funct = function (B $b) { print_r($b::get()); }; $closure = &$funct; $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 LW4UO
Output for 7.0.0 - 7.2.0
ARGS: array(1) { [0]=> object(ReflectionParameter)#4 (1) { ["name"]=> string(1) "b" } }
Output for 5.3.18 - 5.6.28
ARGS: array(1) { [0]=> &object(ReflectionParameter)#4 (1) { ["name"]=> string(1) "b" } }