3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ref = new \ReflectionClass('\Exception'); var_dump($ref); $ser = serialize($ref); var_dump($ser); $unser = unserialize($ref); var_dump($unser);
Output for 7.0.0 - 7.1.0
object(ReflectionClass)#1 (1) { ["name"]=> string(9) "Exception" } string(54) "O:15:"ReflectionClass":1:{s:4:"name";s:9:"Exception";}" Notice: unserialize(): Error at offset 0 of 1606 bytes in /in/9o5u0 on line 11 bool(false)
Output for hhvm-3.12.0
object(ReflectionClass)#1 (2) { ["name"]=> string(9) "Exception" ["obj":"ReflectionClass":private]=> NULL } string(114) "O:15:"ReflectionClass":3:{s:4:"name";s:9:"Exception";s:20:"ReflectionClassobj";N;s:7:"native";s:9:"Exception";}" Notice: Unable to unserialize: [Class [ <internal:> class Exception implements __SystemLib\Throwable, Stringish ] { - Constants [0] { } - Static properties [1] { Property [ private static $traceOpts ] } - Static methods [2] { Method [ <internal> static public method getTraceOptions ] { } Method [ <internal> static public method setTraceOptions ] { - Parameters [1] { Parameter #0 [ <required> $opts ] } } } - Properties [7] { Property [ <default> protected $message ] Property [ <default> private $string ] Property [ <default> protected $code ] Property [ <default> protected $file ] Property [ <default> protected $line ] Property [ <default> private $trace ] Property [ <default> private $previous ] } - Methods [15] { Method [ <internal, ctor> public method __construct ] { - Parameters [3] { Parameter #0 [ <optional> $message = '' ] Parameter #1 [ <optional> $code = 0 ] Parameter #2 [ <optional> ]. Expected ':' but got 'l'. in /in/9o5u0 on line 11 bool(false)
Output for hhvm-3.10.0
object(ReflectionClass)#1 (2) { ["name"]=> string(9) "Exception" ["obj":"ReflectionClass":private]=> NULL } string(114) "O:15:"ReflectionClass":3:{s:4:"name";s:9:"Exception";s:20:"ReflectionClassobj";N;s:7:"native";s:9:"Exception";}" Notice: Unable to unserialize: [Class [ <internal:> class Exception implements Stringish ] { - Constants [0] { } - Static properties [1] { Property [ private static $traceOpts ] } - Static methods [2] { Method [ <internal> static public method getTraceOptions ] { } Method [ <internal> static public method setTraceOptions ] { - Parameters [1] { Parameter #0 [ <required> $opts ] } } } - Properties [7] { Property [ <default> protected $message ] Property [ <default> private $string ] Property [ <default> protected $code ] Property [ <default> protected $file ] Property [ <default> protected $line ] Property [ <default> private $trace ] Property [ <default> private $previous ] } - Methods [15] { Method [ <internal> final public method __init__ ] { } Method [ <internal> private method __check_init ] { - Parameters [1] { Parameter #0 [ <required> $context ] } } Method [ <internal, ctor> publi]. Expected ':' but got 'l'. in /in/9o5u0 on line 11 bool(false)
Output for 5.4.44 - 5.4.45, 5.5.28 - 5.5.35, 5.6.12 - 5.6.28
object(ReflectionClass)#1 (1) { ["name"]=> string(9) "Exception" } string(54) "O:15:"ReflectionClass":1:{s:4:"name";s:9:"Exception";}" Notice: unserialize(): Error at offset 0 of 1417 bytes in /in/9o5u0 on line 11 bool(false)
Output for 5.3.0 - 5.4.43, 5.5.24 - 5.5.27, 5.6.8 - 5.6.11
object(ReflectionClass)#1 (1) { ["name"]=> string(9) "Exception" } string(54) "O:15:"ReflectionClass":1:{s:4:"name";s:9:"Exception";}" Notice: unserialize(): Error at offset 0 of 1354 bytes in /in/9o5u0 on line 11 bool(false)
Output for 5.0.3 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9o5u0 on line 3 Fatal error: Uncaught exception 'ReflectionException' with message 'Class \Exception does not exist' in /in/9o5u0:3 Stack trace: #0 /in/9o5u0(3): ReflectionClass->__construct('\Exception') #1 {main} thrown in /in/9o5u0 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9o5u0 on line 3 Fatal error: Uncaught exception 'ReflectionException' with message 'Class \Exception does not exist' in /in/9o5u0:3 Stack trace: #0 {main} thrown in /in/9o5u0 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9o5u0 on line 3 Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/9o5u0 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9o5u0 on line 3 Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/9o5u0 on line 3