I tried below code :
<?php
class A {
public static function who($simba) {
echo "A\n";
echo $simba;
}
}
class B extends A {
public static function who() {
echo "B\n";
}
}
call_user_func(array('B', 'parent::who'), $nangal="huip");
?>
Output :
Warning: Declaration of B::who() should be compatible with A::who($simba)
A huip
Why I'm getting this warning? I want to remove it. So, please guide me.
When overriding methods in PHP, The Overriding method signature should be compatible with parent same method! This means you should declare a public static function who($simba)
in extended class!