3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public static function create ($a) { print 'A: ' . $a . ' ' . $b . "\n"; } } class B extends A { public static function create ($a, $b) { print 'B: ' . $a . "\n"; } } A::create(1, 2); B::create(3);
Output for 7.1.0 - 7.2.0
Warning: Declaration of B::create($a, $b) should be compatible with A::create($a) in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::create(), 1 passed in /in/sfvAV on line 12 and exactly 2 expected in /in/sfvAV:8 Stack trace: #0 /in/sfvAV(12): B::create(3) #1 {main} thrown in /in/sfvAV on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Declaration of B::create($a, $b) should be compatible with A::create($a) in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Warning: Missing argument 2 for B::create(), called in /in/sfvAV on line 12 and defined in /in/sfvAV on line 8 B: 3
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of B::create() should be compatible with A::create($a) in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Warning: Missing argument 2 for B::create(), called in /in/sfvAV on line 12 and defined in /in/sfvAV on line 8 B: 3
Output for 5.1.0 - 5.3.29
Strict Standards: Declaration of B::create() should be compatible with that of A::create() in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Warning: Missing argument 2 for B::create(), called in /in/sfvAV on line 12 and defined in /in/sfvAV on line 8 B: 3
Output for 5.0.4 - 5.0.5
Strict Standards: Declaration of B::create() should be compatible with that of A::create() in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Warning: Missing argument 2 for B::create() in /in/sfvAV on line 8 B: 3
Output for 5.0.0 - 5.0.3
Strict Standards: Declaration of B::create() should be compatible with that of A::create() in /in/sfvAV on line 9 Notice: Undefined variable: b in /in/sfvAV on line 4 A: 1 Warning: Missing argument 2 for B::create() in /in/sfvAV on line 8 B: 3
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sfvAV on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sfvAV on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/sfvAV on line 4
Process exited with code 255.