<?php
class A { public function foo($a = 1) {;}}
class B extends A { public function foo($a) {;}}
$b = new B();
function bar(A $a) {$a->foo();}
bar($b);
Warning: Declaration of B::foo($a) should be compatible with A::foo($a = 1) in /in/dgdFi on line 4
Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::foo(), 0 passed in /in/dgdFi on line 7 and exactly 1 expected in /in/dgdFi:4
Stack trace:
#0 /in/dgdFi(7): B->foo()
#1 /in/dgdFi(9): bar(Object(B))
#2 {main}
thrown in /in/dgdFi on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Declaration of B::foo($a) should be compatible with A::foo($a = 1) in /in/dgdFi on line 4
Warning: Missing argument 1 for B::foo(), called in /in/dgdFi on line 7 and defined in /in/dgdFi on line 4
Strict Standards: Declaration of B::foo() should be compatible with A::foo($a = 1) in /in/dgdFi on line 4
Warning: Missing argument 1 for B::foo(), called in /in/dgdFi on line 7 and defined in /in/dgdFi on line 4