<?php
class A {
public function foo($a, $b, $c) {
var_dump(func_get_args());
}
}
class B extends A {
public function foo($a, $b, $c, $d = null) {
var_dump(func_get_args());
}
}
$b = new B;
$b->foo();
Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::foo(), 0 passed in /in/FoCji on line 16 and at least 3 expected in /in/FoCji:10
Stack trace:
#0 /in/FoCji(16): B->foo()
#1 {main}
thrown in /in/FoCji on line 10
Process exited with code 255.
Warning: Missing argument 1 for B::foo(), called in /in/FoCji on line 16 and defined in /in/FoCji on line 10
Warning: Missing argument 2 for B::foo(), called in /in/FoCji on line 16 and defined in /in/FoCji on line 10
Warning: Missing argument 3 for B::foo(), called in /in/FoCji on line 16 and defined in /in/FoCji on line 10
array(0) {
}
Output for 5.0.0 - 5.0.5
Warning: Missing argument 1 for B::foo() in /in/FoCji on line 10
Warning: Missing argument 2 for B::foo() in /in/FoCji on line 10
Warning: Missing argument 3 for B::foo() in /in/FoCji on line 10
array(0) {
}
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/FoCji on line 4
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FoCji 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/FoCji on line 4
Process exited with code 255.