3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test {} $r = new \ReflectionClass('Test'); $r->newInstanceArgs(array()); var_dump($r);
Output for 5.3.4 - 5.6.28, 7.0.0 - 7.1.0
object(ReflectionClass)#1 (1) { ["name"]=> string(4) "Test" }
Output for hhvm-3.10.0 - 3.13.2
object(ReflectionClass)#1 (2) { ["name"]=> string(4) "Test" ["obj":"ReflectionClass":private]=> NULL }
Output for 5.3.0 - 5.3.3
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Test does not have a constructor, so you cannot pass any constructor arguments' in /in/rX2bp:8 Stack trace: #0 /in/rX2bp(8): ReflectionClass->newInstanceArgs(Array) #1 {main} thrown in /in/rX2bp on line 8
Process exited with code 255.
Output for 5.1.3 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/rX2bp on line 6 Fatal error: Uncaught exception 'ReflectionException' with message 'Class Test does not have a constructor, so you cannot pass any constructor arguments' in /in/rX2bp:8 Stack trace: #0 /in/rX2bp(8): ReflectionClass->newInstanceArgs(Array) #1 {main} thrown in /in/rX2bp on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.2
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/rX2bp on line 6 Fatal error: Call to undefined method ReflectionClass::newInstanceArgs() in /in/rX2bp on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/rX2bp on line 6 Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/rX2bp on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/rX2bp on line 6 Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/rX2bp on line 6