什么是PHP方法来做一个正确的覆盖?PHP替代方式
php -a
Interactive mode enabled
php > error_reporting(E_ALL);
php > class A { public function z($a, $b){} }
php > class B extends A { public function z($a){parent::z($a, '1');} }
PHP Strict standards: Declaration of B::z() should be compatible with A::z($a, $b) in php shell code on line 1
注:覆盖是英文正确的单词?
是的,在这种情况下,覆盖是正确的。然而,_Work_不是。 – Cthulhu