3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ref = new ReflectionClass('PDO'); foreach ($ref->getConstants() as $constant) { printf("%s => %s\n", $constant->getName(), $constant->getValue()); }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to a member function getName() on integer in /in/AD8b3:5 Stack trace: #0 {main} thrown in /in/AD8b3 on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Call to a member function getName() on integer in /in/AD8b3 on line 5
Process exited with code 255.
Output for 5.2.3 - 5.5.35
Fatal error: Call to a member function getName() on a non-object in /in/AD8b3 on line 5
Process exited with code 255.
Output for 5.1.0 - 5.2.2
<br /> <b>Fatal error</b>: Call to a member function getName() on a non-object in <b>/in/AD8b3</b> on line <b>5</b><br />
Process exited with code 255.
Output for 5.0.3 - 5.0.5
<br /> <b>Fatal error</b>: Uncaught exception 'ReflectionException' with message 'Class PDO does not exist' in /in/AD8b3:2 Stack trace: #0 /in/AD8b3(2): ReflectionClass->__construct('PDO') #1 {main} thrown in <b>/in/AD8b3</b> on line <b>2</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.2
<br /> <b>Fatal error</b>: Uncaught exception 'ReflectionException' with message 'Class PDO does not exist' in /in/AD8b3:2 Stack trace: #0 {main} thrown in <b>/in/AD8b3</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: reflectionclass in <b>/in/AD8b3</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: reflectionclass in <b>/in/AD8b3</b> on line <b>2</b><br />