3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $an_array = array(); $reflection = new ReflectionClass($an_object); $properties = $reflection->getProperties(); foreach ($properties as $property) { $property->setAccessible(true); $an_array[$property->getName()] = $property->getValue($an_object); if (!$property->isPublic()) $property->setAccessible(false); } var_dump($an_array); ?>
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: an_object in /in/rVsOr on line 4 Fatal error: Uncaught ReflectionException: Class does not exist in /in/rVsOr:4 Stack trace: #0 /in/rVsOr(4): ReflectionClass->__construct('') #1 {main} thrown in /in/rVsOr on line 4
Process exited with code 255.
Output for 5.0.4 - 5.6.28
Notice: Undefined variable: an_object in /in/rVsOr on line 4 Fatal error: Uncaught exception 'ReflectionException' with message 'Class does not exist' in /in/rVsOr:4 Stack trace: #0 /in/rVsOr(4): ReflectionClass->__construct('') #1 {main} thrown in /in/rVsOr on line 4
Process exited with code 255.
Output for 5.0.3
Notice: Undefined variable: an_object in /in/rVsOr on line 4 Fatal error: Uncaught exception 'ReflectionException' with message 'Class does not exist' in /in/rVsOr:4 Stack trace: #0 /in/rVsOr(4): ReflectionClass->__construct('') #1 {main} thrown in /in/rVsOr on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Undefined variable: an_object in /in/rVsOr on line 4 Fatal error: Uncaught exception 'ReflectionException' with message 'Class does not exist' in /in/rVsOr:4 Stack trace: #0 {main} thrown in /in/rVsOr on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/rVsOr on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/rVsOr on line 4