3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump($a = new stdClass); var_dump($b = new $obj); var_dump($a === $b);
Output for 7.0.0 - 7.1.0
object(stdClass)#1 (0) { } Notice: Undefined variable: obj in /in/3K8Cg on line 4 Fatal error: Uncaught Error: Class name must be a valid object or a string in /in/3K8Cg:4 Stack trace: #0 {main} thrown in /in/3K8Cg on line 4
Process exited with code 255.
Output for hhvm-3.12.0
object(stdClass)#1 (0) { } Fatal error: Uncaught Error: Cls: Expected string or object in /in/3K8Cg:4 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
object(stdClass)#1 (0) { } Fatal error: Cls: Expected string or object in /in/3K8Cg on line 4
Process exited with code 255.
Output for 5.0.4 - 5.6.28
object(stdClass)#1 (0) { } Notice: Undefined variable: obj in /in/3K8Cg on line 4 Fatal error: Class name must be a valid object or a string in /in/3K8Cg on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.3
object(stdClass)#1 (0) { } Notice: Undefined variable: obj in /in/3K8Cg on line 4 Fatal error: Class name must be a valid object or a string in /in/3K8Cg on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
object(stdClass)(0) { } Notice: Undefined variable: obj in /in/3K8Cg on line 4 Fatal error: Cannot instantiate non-existent class: in /in/3K8Cg on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
object(stdClass)(0) { } Notice: Undefined variable: obj in /in/3K8Cg on line 4 Fatal error: Cannot instantiate non-existent class: in /in/3K8Cg on line 4