|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-01 00:21 UTC] felipe@php.net
[2009-02-03 19:51 UTC] cellog@php.net
[2009-02-03 19:53 UTC] stas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Description: ------------ A Strict-Warning is raised when the parameters of the subclass differ from the parameters of the overwritten superclass method. This error seems only to occure if any interface is included in the superclass Reproduce code: --------------- class A implements Iterator { public function current() {} public function key() {} public function next() {} public function rewind() {} public function valid() {} public function f($x) { echo $x.PHP_EOL; } } class B extends A { public function f($x,$y) { echo __METHOD__.'('.$x.', '.$y.')'.PHP_EOL; } } $b = new B(); $b->f(1,2); Expected result: ---------------- B::f(1, 2) Actual result: -------------- Strict Standards: Declaration of B::f() should be compatible with that of A::f() in /index.php on line 19