3v4l.org

run code in 150+ 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() . '<br>';}
Output for 7.1.0
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<br>__wakeup<br>__set_state<br>createFromFormat<br>getLastErrors<br>format<br>modify<br>add<br>sub<br>getTimezone<br>setTimezone<br>getOffset<br>setTime<br>setDate<br>setISODate<br>setTimestamp<br>getTimestamp<br>diff<br>
Output for 7.0.0 - 7.0.14
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<br>__wakeup<br>__set_state<br>createFromFormat<br>getLastErrors<br>format<br>modify<br>add<br>sub<br>getTimezone<br>setTimezone<br>getOffset<br>setTime<br>setDate<br>setISODate<br>setTimestamp<br>getTimestamp<br>diff<br>
Output for hhvm-3.10.0 - 3.12.0
Array ( ) add<br>__construct<br>createFromFormat<br>diff<br>format<br>getLastErrors<br>getOffset<br>getTimestamp<br>getTimezone<br>modify<br>setDate<br>setISODate<br>setTime<br>setTimestamp<br>setTimezone<br>sub<br>__sleep<br>__wakeup<br>__debugInfo<br>
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<br>__wakeup<br>__set_state<br>createFromFormat<br>getLastErrors<br>format<br>modify<br>add<br>sub<br>getTimezone<br>setTimezone<br>getOffset<br>setTime<br>setDate<br>setISODate<br>setTimestamp<br>getTimestamp<br>diff<br>
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<br>__wakeup<br>__set_state<br>createFromFormat<br>getLastErrors<br>format<br>modify<br>add<br>sub<br>getTimezone<br>setTimezone<br>getOffset<br>setTime<br>setDate<br>setISODate<br>setTimestamp<br>getTimestamp<br>diff<br>
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<br>format<br>modify<br>getTimezone<br>setTimezone<br>getOffset<br>setTime<br>setDate<br>setISODate<br>
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/EG2sv:5 Stack trace: #0 /in/EG2sv(5): ReflectionClass->__construct('DateTime') #1 {main} thrown in /in/EG2sv 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/EG2sv:2 Stack trace: #0 /in/EG2sv(2): ReflectionExtension->__construct('Reflection') #1 {main} thrown in /in/EG2sv 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/EG2sv:2 Stack trace: #0 {main} thrown in /in/EG2sv on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/EG2sv 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/EG2sv on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/EG2sv on line 6
Process exited with code 255.