3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function b($a) { } } class B extends A { function b($b) { } } new B;
Output for 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; B has a deprecated constructor in /in/XtPsL on line 7 Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::b(), 0 passed in /in/XtPsL on line 12 and exactly 1 expected in /in/XtPsL:8 Stack trace: #0 /in/XtPsL(12): B->b() #1 {main} thrown in /in/XtPsL on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; B has a deprecated constructor in /in/XtPsL on line 7 Warning: Missing argument 1 for B::b(), called in /in/XtPsL on line 12 and defined in /in/XtPsL on line 8
Output for 5.1.0 - 5.6.22
Warning: Missing argument 1 for B::b(), called in /in/XtPsL on line 12 and defined in /in/XtPsL on line 8
Output for 5.0.0 - 5.0.5
Warning: Missing argument 1 for B::b() in /in/XtPsL on line 8
Output for 4.3.0 - 4.4.9
Warning: Missing argument 1 for b() in /in/XtPsL on line 8