<?php
$obj = new stdClass(1, 2, 3); // OK, but do nothing
$ref = new ReflectionClass('stdClass');
$obj = $ref->newInstance(1, 2, 3); // NOT OK: Class stdClass does not have a constructor, so you cannot pass any constructor arguments
Fatal error: Uncaught ReflectionException: Class stdClass does not have a constructor, so you cannot pass any constructor arguments in /in/Tjn82:5
Stack trace:
#0 /in/Tjn82(5): ReflectionClass->newInstance(1, 2, 3)
#1 {main}
thrown in /in/Tjn82 on line 5
Process exited with code 255.
Fatal error: Uncaught exception 'ReflectionException' with message 'Class stdClass does not have a constructor, so you cannot pass any constructor arguments' in /in/Tjn82:5
Stack trace:
#0 /in/Tjn82(5): ReflectionClass->newInstance(1, 2, 3)
#1 {main}
thrown in /in/Tjn82 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.2
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Tjn82 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/Tjn82 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/Tjn82 on line 4