3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function test() { var_dump('super class'); } } class B extends A { function test($a) { var_dump('inherited class'); } } $b = new B; $b->test(); $b->test(1);
Output for 7.1.0
Warning: Declaration of B::test($a) should be compatible with A::test() in /in/FDKbO on line 12 Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::test(), 0 passed in /in/FDKbO on line 15 and exactly 1 expected in /in/FDKbO:9 Stack trace: #0 /in/FDKbO(15): B->test() #1 {main} thrown in /in/FDKbO on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Warning: Declaration of B::test($a) should be compatible with A::test() in /in/FDKbO on line 12 Warning: Missing argument 1 for B::test(), called in /in/FDKbO on line 15 and defined in /in/FDKbO on line 9 string(15) "inherited class" string(15) "inherited class"
Output for hhvm-3.12.0
Warning: test() expects exactly 1 parameter, 0 given in /in/FDKbO on line 10 string(15) "inherited class" string(15) "inherited class"
Output for hhvm-3.10.0
Warning: test() expects exactly 1 parameter, 0 given in /in/FDKbO on line -1 string(15) "inherited class" string(15) "inherited class"
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of B::test() should be compatible with A::test() in /in/FDKbO on line 12 Warning: Missing argument 1 for B::test(), called in /in/FDKbO on line 15 and defined in /in/FDKbO on line 9 string(15) "inherited class" string(15) "inherited class"
Output for 5.1.0 - 5.3.29
Strict Standards: Declaration of B::test() should be compatible with that of A::test() in /in/FDKbO on line 12 Warning: Missing argument 1 for B::test(), called in /in/FDKbO on line 15 and defined in /in/FDKbO on line 9 string(15) "inherited class" string(15) "inherited class"
Output for 5.0.0 - 5.0.5
Strict Standards: Declaration of B::test() should be compatible with that of A::test() in /in/FDKbO on line 12 Warning: Missing argument 1 for B::test() in /in/FDKbO on line 9 string(15) "inherited class" string(15) "inherited class"
Output for 4.3.0 - 4.4.9
Warning: Missing argument 1 for test() in /in/FDKbO on line 9 string(15) "inherited class" string(15) "inherited class"