3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { } class B { public function test(A $a) { var_dump($a); } } class C extends B { public function test($a) { parent::test($a); } } $c = new C; $c->test(new $a);
Output for 7.2.0
Notice: Undefined variable: a in /in/qlFSL on line 19 Fatal error: Uncaught Error: Class name must be a valid object or a string in /in/qlFSL:19 Stack trace: #0 {main} thrown in /in/qlFSL on line 19
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Warning: Declaration of C::test($a) should be compatible with B::test(A $a) in /in/qlFSL on line 16 Notice: Undefined variable: a in /in/qlFSL on line 19 Fatal error: Uncaught Error: Class name must be a valid object or a string in /in/qlFSL:19 Stack trace: #0 {main} thrown in /in/qlFSL on line 19
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Strict Standards: Declaration of C::test() should be compatible with B::test(A $a) in /in/qlFSL on line 16 Notice: Undefined variable: a in /in/qlFSL on line 19 Fatal error: Class name must be a valid object or a string in /in/qlFSL on line 19
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Strict Standards: Declaration of C::test() should be compatible with that of B::test() in /in/qlFSL on line 16 Notice: Undefined variable: a in /in/qlFSL on line 19 Fatal error: Class name must be a valid object or a string in /in/qlFSL on line 19
Process exited with code 255.