Bug #63816 [Asn->Csd]: implementation child interface and after parent cause fatal error.

From: Date: Fri, 06 Mar 2020 10:18:00 +0000
Subject: Bug #63816 [Asn->Csd]: implementation child interface and after parent cause fatal error.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225920@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63816&edit=1 ID: 63816 Updated by: nikic@php.net Reported by: kotlyar dot maksim at gmail dot com Summary: implementation child interface and after parent cause fatal error. -Status: Assigned +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: linux PHP Version: 5.4.7 Assigned To: nikic Block user comment: N Private report: N New Comment: This has been fixed in PHP 7.4, I've added a test in https://github.com/php/php-src/commit/c3ab8fd3f8d8212d51b14f4d9529fd1fd1f7c2ab. Previous Comments: ------------------------------------------------------------------------ [2016-09-01 07:40:07] xedin dot unknown at gmail dot com Of course this is a bug. "Re-implementing" an interface in such a way only says twice that certain signatures must be present. As has been said, this situation can be resolved easily without failure. I don't believe that this deserves a fatal error, but a warning at most. ------------------------------------------------------------------------ [2016-01-16 13:00:30] danack@php.net Related, the checks for method signatures are done in an order dependent manner, https://bugs.php.net/bug.php?id=67270 ------------------------------------------------------------------------ [2016-01-14 13:10:51] danack@php.net Dmitry wrote: "it's not a big deal to fix a script once you see this FATAL error." Why should people have to fix their script. There is nothing wrong with their code, PHP is just being a bit dumb. "so the following buggy code becomes legal. <?php interface foo {} class bar implements foo, foo {} ?> " I don't see the problem. All that implementing an interface does is say that a class must implement certain methods with particular signatures. Although implementing an interface multiple times doesn't add anything, I can't see the problem for the simple case, But for more complex cases where someone has multiple classes that implement various interfaces, including the "\Serializable" interface. They then realise that one of the user-defined interfaces should actually extend "\Serializable". Doing that, would make some code break, depending on what order the implements interfaces was written as. That's a real problem that imo people shouldn't have to 'fix their scripts' for. ------------------------------------------------------------------------ [2013-02-18 00:36:10] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2013-01-11 12:03:19] kotlyar dot maksim at gmail dot com I think that described order of interfaces is absolutely correct. So there should not be a warning\fatal. About BC break. I dont feel like expert in this question. Personally I dont think that this BC break would be a problem because: 1) There are few developers how can implement interfaces in this order. 2) They will be affected only while downgrade of php version. 3) The fatal error message gives some usefull info about what could be a problem. 4) The change log of php 5.5 would contain description of this change. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=63816 -- Edit this bug report at https://bugs.php.net/bug.php?id=63816&edit=1

« previous php.bugs (#225920) next »