<?php
class NotFinal {
protected function hello($string = '' ) {
echo 'hello';
}
}
final class ThisIsFinal extends NotFinal {
public function hello(array $witharg) {
return parent::hello();
}
}
$class = new ThisIsFinal();
$class->hello();
Fatal error: Declaration of ThisIsFinal::hello(array $witharg) must be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 10
Fatal error: Uncaught ArgumentCountError: Too few arguments to function ThisIsFinal::hello(), 0 passed in /in/OZ7W6 on line 16 and exactly 1 expected in /in/OZ7W6:10
Stack trace:
#0 /in/OZ7W6(16): ThisIsFinal->hello()
#1 {main}
thrown in /in/OZ7W6 on line 10
Process exited with code 255.
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13
Fatal error: Uncaught ArgumentCountError: Too few arguments to function ThisIsFinal::hello(), 0 passed in /in/OZ7W6 on line 16 and exactly 1 expected in /in/OZ7W6:10
Stack trace:
#0 /in/OZ7W6(16): ThisIsFinal->hello()
#1 {main}
thrown in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13
Fatal error: Uncaught TypeError: Argument 1 passed to ThisIsFinal::hello() must be of the type array, none given, called in /in/OZ7W6 on line 16 and defined in /in/OZ7W6:10
Stack trace:
#0 /in/OZ7W6(16): ThisIsFinal->hello()
#1 {main}
thrown in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Strict Standards: Declaration of ThisIsFinal::hello() should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13
Catchable fatal error: Argument 1 passed to ThisIsFinal::hello() must be of the type array, none given, called in /in/OZ7W6 on line 16 and defined in /in/OZ7W6 on line 10
Process exited with code 255.