3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A {} class B extends A {} $b = new B(); echo get_parent_class($b); get_class('Character'); $name = 'Character'; $arguments = array(); $reflect = new \ReflectionClass($name); print_r($reflect); print_r($name); print_r($arguments); $o = $reflect->newInstanceArgs($arguments);
Output for 7.0.0 - 7.1.0
A Warning: get_class() expects parameter 1 to be object, string given in /in/mSgQA on line 10 Fatal error: Uncaught ReflectionException: Class Character does not exist in /in/mSgQA:15 Stack trace: #0 /in/mSgQA(15): ReflectionClass->__construct('Character') #1 {main} thrown in /in/mSgQA on line 15
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
A Fatal error: Uncaught exception 'ReflectionException' with message 'Class Character does not exist' in /in/mSgQA:15 Stack trace: #0 /in/mSgQA(15): ReflectionClass->__construct() #1 {main}
Process exited with code 255.
Output for 5.3.7 - 5.6.28
A Warning: get_class() expects parameter 1 to be object, string given in /in/mSgQA on line 10 Fatal error: Uncaught exception 'ReflectionException' with message 'Class Character does not exist' in /in/mSgQA:15 Stack trace: #0 /in/mSgQA(15): ReflectionClass->__construct('Character') #1 {main} thrown in /in/mSgQA on line 15
Process exited with code 255.