3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A{ function B($x , $y=null , $z=null) { } } $m = new ReflectionMethod('a','b'); $p = $m->getParameters(); var_dump($p);
Output for 7.0.0 - 7.2.0
array(3) { [0]=> object(ReflectionParameter)#2 (1) { ["name"]=> string(1) "x" } [1]=> object(ReflectionParameter)#3 (1) { ["name"]=> string(1) "y" } [2]=> object(ReflectionParameter)#4 (1) { ["name"]=> string(1) "z" } }
Output for 5.3.18 - 5.6.28
array(3) { [0]=> &object(ReflectionParameter)#2 (1) { ["name"]=> string(1) "x" } [1]=> &object(ReflectionParameter)#3 (1) { ["name"]=> string(1) "y" } [2]=> &object(ReflectionParameter)#4 (1) { ["name"]=> string(1) "z" } }