3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function __construct(\stdClass $a) { } } $x = new A(null);
based on pS1r2
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught TypeError: Argument 1 passed to A::__construct() must be an instance of stdClass, null given, called in /in/dAYA5 on line 9 and defined in /in/dAYA5:4 Stack trace: #0 /in/dAYA5(9): A->__construct(NULL) #1 {main} thrown in /in/dAYA5 on line 4
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to A::__construct() must be an instance of stdClass, null given in /in/dAYA5:-1 Stack trace: #0 /in/dAYA5(-1): A->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to A::__construct() must be an instance of stdClass, null given in /in/dAYA5:6 Stack trace: #0 /in/dAYA5(9): A->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to A::__construct() must be an instance of stdClass, null given, called in /in/dAYA5 on line 9 and defined in /in/dAYA5 on line 4
Process exited with code 255.