|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-06-25 08:11 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
Description: ------------ <?php class X {} interface A extends IteratorAggregate { function getIterator() : X; } interface B extends IteratorAggregate, A { } Fatal error: Declaration of IteratorAggregate::getIterator() must be compatible with A::getIterator(): X in /home/nikic/php-src/t030.php on line 9 This happens because we first inherit the IteratorAggregate::getIterator() method and then check it against the A::getIterator() method - which is of course wrong. This is a problem with return types, because they are not fully invariant - not sure if it might also be a problem for some things before PHP 7.