3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a= new stdClass(array('class_name' => 'stdClass')); $b = new $a->std_class(); var_dump($b);
Output for 7.0.0 - 7.3.0rc4
Notice: Undefined property: stdClass::$std_class in /in/ZAAfL on line 3 Fatal error: Uncaught Error: Class name must be a valid object or a string in /in/ZAAfL:3 Stack trace: #0 {main} thrown in /in/ZAAfL on line 3
Process exited with code 255.
Output for 5.2.6 - 5.6.26
Notice: Undefined property: stdClass::$std_class in /in/ZAAfL on line 3 Fatal error: Class name must be a valid object or a string in /in/ZAAfL on line 3
Process exited with code 255.
Output for 5.0.0 - 5.2.5
Notice: Undefined property: stdClass::$std_class in /in/ZAAfL on line 3 Fatal error: Class name must be a valid object or a string in /in/ZAAfL on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined property: std_class in /in/ZAAfL on line 3 Fatal error: Cannot instantiate non-existent class: in /in/ZAAfL on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined property: std_class in /in/ZAAfL on line 3 Fatal error: Cannot instantiate non-existent class: in /in/ZAAfL on line 3