3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $c = new ReflectionClass('Exception'); var_dump($c->getConstants(), $c->getMethods()); var_dump(get_parent_class("Exception"));
based on pQTV9
Output for 7.0.0 - 7.2.0
array(0) { } array(11) { [0]=> object(ReflectionMethod)#2 (2) { ["name"]=> string(7) "__clone" ["class"]=> string(9) "Exception" } [1]=> object(ReflectionMethod)#3 (2) { ["name"]=> string(11) "__construct" ["class"]=> string(9) "Exception" } [2]=> object(ReflectionMethod)#4 (2) { ["name"]=> string(8) "__wakeup" ["class"]=> string(9) "Exception" } [3]=> object(ReflectionMethod)#5 (2) { ["name"]=> string(10) "getMessage" ["class"]=> string(9) "Exception" } [4]=> object(ReflectionMethod)#6 (2) { ["name"]=> string(7) "getCode" ["class"]=> string(9) "Exception" } [5]=> object(ReflectionMethod)#7 (2) { ["name"]=> string(7) "getFile" ["class"]=> string(9) "Exception" } [6]=> object(ReflectionMethod)#8 (2) { ["name"]=> string(7) "getLine" ["class"]=> string(9) "Exception" } [7]=> object(ReflectionMethod)#9 (2) { ["name"]=> string(8) "getTrace" ["class"]=> string(9) "Exception" } [8]=> object(ReflectionMethod)#10 (2) { ["name"]=> string(11) "getPrevious" ["class"]=> string(9) "Exception" } [9]=> object(ReflectionMethod)#11 (2) { ["name"]=> string(16) "getTraceAsString" ["class"]=> string(9) "Exception" } [10]=> object(ReflectionMethod)#12 (2) { ["name"]=> string(10) "__toString" ["class"]=> string(9) "Exception" } } bool(false)
Output for 5.4.44 - 5.4.45, 5.5.28 - 5.5.35, 5.6.12 - 5.6.28
array(0) { } array(11) { [0]=> &object(ReflectionMethod)#2 (2) { ["name"]=> string(7) "__clone" ["class"]=> string(9) "Exception" } [1]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(11) "__construct" ["class"]=> string(9) "Exception" } [2]=> &object(ReflectionMethod)#4 (2) { ["name"]=> string(8) "__wakeup" ["class"]=> string(9) "Exception" } [3]=> &object(ReflectionMethod)#5 (2) { ["name"]=> string(10) "getMessage" ["class"]=> string(9) "Exception" } [4]=> &object(ReflectionMethod)#6 (2) { ["name"]=> string(7) "getCode" ["class"]=> string(9) "Exception" } [5]=> &object(ReflectionMethod)#7 (2) { ["name"]=> string(7) "getFile" ["class"]=> string(9) "Exception" } [6]=> &object(ReflectionMethod)#8 (2) { ["name"]=> string(7) "getLine" ["class"]=> string(9) "Exception" } [7]=> &object(ReflectionMethod)#9 (2) { ["name"]=> string(8) "getTrace" ["class"]=> string(9) "Exception" } [8]=> &object(ReflectionMethod)#10 (2) { ["name"]=> string(11) "getPrevious" ["class"]=> string(9) "Exception" } [9]=> &object(ReflectionMethod)#11 (2) { ["name"]=> string(16) "getTraceAsString" ["class"]=> string(9) "Exception" } [10]=> &object(ReflectionMethod)#12 (2) { ["name"]=> string(10) "__toString" ["class"]=> string(9) "Exception" } } bool(false)
Output for 5.3.0 - 5.4.43, 5.5.24 - 5.5.27, 5.6.8 - 5.6.11
array(0) { } array(10) { [0]=> &object(ReflectionMethod)#2 (2) { ["name"]=> string(7) "__clone" ["class"]=> string(9) "Exception" } [1]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(11) "__construct" ["class"]=> string(9) "Exception" } [2]=> &object(ReflectionMethod)#4 (2) { ["name"]=> string(10) "getMessage" ["class"]=> string(9) "Exception" } [3]=> &object(ReflectionMethod)#5 (2) { ["name"]=> string(7) "getCode" ["class"]=> string(9) "Exception" } [4]=> &object(ReflectionMethod)#6 (2) { ["name"]=> string(7) "getFile" ["class"]=> string(9) "Exception" } [5]=> &object(ReflectionMethod)#7 (2) { ["name"]=> string(7) "getLine" ["class"]=> string(9) "Exception" } [6]=> &object(ReflectionMethod)#8 (2) { ["name"]=> string(8) "getTrace" ["class"]=> string(9) "Exception" } [7]=> &object(ReflectionMethod)#9 (2) { ["name"]=> string(11) "getPrevious" ["class"]=> string(9) "Exception" } [8]=> &object(ReflectionMethod)#10 (2) { ["name"]=> string(16) "getTraceAsString" ["class"]=> string(9) "Exception" } [9]=> &object(ReflectionMethod)#11 (2) { ["name"]=> string(10) "__toString" ["class"]=> string(9) "Exception" } } bool(false)
Output for 5.0.0 - 5.2.17
array(0) { } array(9) { [0]=> &object(ReflectionMethod)#2 (2) { ["name"]=> string(7) "__clone" ["class"]=> string(9) "Exception" } [1]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(11) "__construct" ["class"]=> string(9) "Exception" } [2]=> &object(ReflectionMethod)#4 (2) { ["name"]=> string(10) "getMessage" ["class"]=> string(9) "Exception" } [3]=> &object(ReflectionMethod)#5 (2) { ["name"]=> string(7) "getCode" ["class"]=> string(9) "Exception" } [4]=> &object(ReflectionMethod)#6 (2) { ["name"]=> string(7) "getFile" ["class"]=> string(9) "Exception" } [5]=> &object(ReflectionMethod)#7 (2) { ["name"]=> string(7) "getLine" ["class"]=> string(9) "Exception" } [6]=> &object(ReflectionMethod)#8 (2) { ["name"]=> string(8) "getTrace" ["class"]=> string(9) "Exception" } [7]=> &object(ReflectionMethod)#9 (2) { ["name"]=> string(16) "getTraceAsString" ["class"]=> string(9) "Exception" } [8]=> &object(ReflectionMethod)#10 (2) { ["name"]=> string(10) "__toString" ["class"]=> string(9) "Exception" } } bool(false)
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/3m92l on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/3m92l on line 3