3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $extension = new ReflectionExtension("Reflection"); print_r($extension->getClassNames()); $class = new ReflectionClass("DateTime"); $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC); foreach ($methods as $m) { echo $m->getName() . PHP_EOL;}
Output for 7.3.0alpha1 - 7.3.0rc4
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionGenerator [6] => ReflectionParameter [7] => ReflectionType [8] => ReflectionNamedType [9] => ReflectionMethod [10] => ReflectionClass [11] => ReflectionObject [12] => ReflectionProperty [13] => ReflectionClassConstant [14] => ReflectionExtension [15] => ReflectionZendExtension ) __construct __wakeup __set_state createFromImmutable createFromFormat getLastErrors format modify add sub getTimezone setTimezone getOffset setTime setDate setISODate setTimestamp getTimestamp diff
Output for 7.1.0 - 7.2.6
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionGenerator [6] => ReflectionParameter [7] => ReflectionType [8] => ReflectionNamedType [9] => ReflectionMethod [10] => ReflectionClass [11] => ReflectionObject [12] => ReflectionProperty [13] => ReflectionClassConstant [14] => ReflectionExtension [15] => ReflectionZendExtension ) __construct __wakeup __set_state createFromFormat getLastErrors format modify add sub getTimezone setTimezone getOffset setTime setDate setISODate setTimestamp getTimestamp diff
Output for 7.0.0 - 7.0.20
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionGenerator [6] => ReflectionParameter [7] => ReflectionType [8] => ReflectionMethod [9] => ReflectionClass [10] => ReflectionObject [11] => ReflectionProperty [12] => ReflectionExtension [13] => ReflectionZendExtension ) __construct __wakeup __set_state createFromFormat getLastErrors format modify add sub getTimezone setTimezone getOffset setTime setDate setISODate setTimestamp getTimestamp diff
Output for 5.4.0 - 5.6.28
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionParameter [6] => ReflectionMethod [7] => ReflectionClass [8] => ReflectionObject [9] => ReflectionProperty [10] => ReflectionExtension [11] => ReflectionZendExtension ) __construct __wakeup __set_state createFromFormat getLastErrors format modify add sub getTimezone setTimezone getOffset setTime setDate setISODate setTimestamp getTimestamp diff
Output for 5.3.0 - 5.3.29
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionParameter [6] => ReflectionMethod [7] => ReflectionClass [8] => ReflectionObject [9] => ReflectionProperty [10] => ReflectionExtension ) __construct __wakeup __set_state createFromFormat getLastErrors format modify add sub getTimezone setTimezone getOffset setTime setDate setISODate setTimestamp getTimestamp diff
Output for 5.2.0 - 5.2.17
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunctionAbstract [4] => ReflectionFunction [5] => ReflectionParameter [6] => ReflectionMethod [7] => ReflectionClass [8] => ReflectionObject [9] => ReflectionProperty [10] => ReflectionExtension ) __construct format modify getTimezone setTimezone getOffset setTime setDate setISODate
Output for 5.1.2 - 5.1.6
Array ( [0] => ReflectionException [1] => Reflection [2] => Reflector [3] => ReflectionFunction [4] => ReflectionParameter [5] => ReflectionMethod [6] => ReflectionClass [7] => ReflectionObject [8] => ReflectionProperty [9] => ReflectionExtension ) Fatal error: Uncaught exception 'ReflectionException' with message 'Class DateTime does not exist' in /in/BTgWE:5 Stack trace: #0 /in/BTgWE(5): ReflectionClass->__construct('DateTime') #1 {main} thrown in /in/BTgWE on line 5
Process exited with code 255.
Output for 5.0.3 - 5.1.1
Fatal error: Uncaught exception 'ReflectionException' with message 'Extension Reflection does not exist' in /in/BTgWE:2 Stack trace: #0 /in/BTgWE(2): ReflectionExtension->__construct('Reflection') #1 {main} thrown in /in/BTgWE on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'ReflectionException' with message 'Extension Reflection does not exist' in /in/BTgWE:2 Stack trace: #0 {main} thrown in /in/BTgWE on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/BTgWE on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/BTgWE on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/BTgWE on line 6
Process exited with code 255.