<?php
class C {
function save($a, $b, $c=NULL) {
echo "save something";
return 1; // id
}
}
class D extends C {
function saveD($a, $b){
return parent::save($a,$b);
}
}
class X extends D {
function save($a, $b, $c){
// do little processing with $c
return $this->saveD($a,$b);
}
}
$x = new X();
$x->save(1,2,"aaaa");
Fatal error: Declaration of X::save($a, $b, $c) must be compatible with C::save($a, $b, $c = null) in /in/hUeXf on line 17
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of X::save($a, $b, $c) should be compatible with C::save($a, $b, $c = NULL) in /in/hUeXf on line 17
save something