3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function method($a = UndefinedClass::UNDEFINED) { } } $rp = new ReflectionParameter(['Test', 'method'], 'a'); try { $val = $rp->getDefaultValue(); } catch (Error $ex) { var_dump($ex); }
Output for git.master, git.master_jit
object(Error)#2 (7) { ["message":protected]=> string(32) "Class "UndefinedClass" not found" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/X1YVX" ["line":protected]=> int(5) ["trace":"Error":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/X1YVX" ["line"]=> int(12) ["function"]=> string(15) "getDefaultValue" ["class"]=> string(19) "ReflectionParameter" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Error":private]=> NULL }
Output for rfc.property-hooks
object(Error)#2 (7) { ["message":protected]=> string(32) "Class "UndefinedClass" not found" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/X1YVX" ["line":protected]=> int(5) ["trace":"Error":private]=> array(2) { [0]=> array(3) { ["file"]=> string(9) "/in/X1YVX" ["line"]=> int(12) ["function"]=> string(21) "[constant expression]" } [1]=> array(6) { ["file"]=> string(9) "/in/X1YVX" ["line"]=> int(12) ["function"]=> string(15) "getDefaultValue" ["class"]=> string(19) "ReflectionParameter" ["type"]=> string(2) "->" ["args"]=> array(0) { } } } ["previous":"Error":private]=> NULL }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
66.53 ms | 402 KiB | 8 Q