<?php
class A {
public function aa(int $a) {
echo $a;
}
}
class B extends A {
public function aa(int $a, float $b) {
echo $a;
}
}
$a = new B();
$a->aa(1);
Fatal error: Declaration of B::aa(int $a, float $b) must be compatible with A::aa(int $a) in /in/Z108c on line 11
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of B::aa(int $a, float $b) should be compatible with A::aa(int $a) in /in/Z108c on line 11
Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::aa(), 1 passed in /in/Z108c on line 17 and exactly 2 expected in /in/Z108c:11
Stack trace:
#0 /in/Z108c(17): B->aa(1)
#1 {main}
thrown in /in/Z108c on line 11
Process exited with code 255.
Warning: Declaration of B::aa(int $a, float $b) should be compatible with A::aa(int $a) in /in/Z108c on line 14
Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::aa(), 1 passed in /in/Z108c on line 17 and exactly 2 expected in /in/Z108c:11
Stack trace:
#0 /in/Z108c(17): B->aa(1)
#1 {main}
thrown in /in/Z108c on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.32
Warning: Declaration of B::aa(int $a, float $b) should be compatible with A::aa(int $a) in /in/Z108c on line 14
Fatal error: Uncaught TypeError: Argument 2 passed to B::aa() must be of the type float, none given, called in /in/Z108c on line 17 and defined in /in/Z108c:11
Stack trace:
#0 /in/Z108c(17): B->aa(1)
#1 {main}
thrown in /in/Z108c on line 11
Process exited with code 255.
Strict Standards: Declaration of B::aa() should be compatible with A::aa(int $a) in /in/Z108c on line 14
Catchable fatal error: Argument 1 passed to B::aa() must be an instance of int, integer given, called in /in/Z108c on line 17 and defined in /in/Z108c on line 11
Process exited with code 255.