Bug #72119 [Opn]: Interface declaration compatibility regression

From: Date: Thu, 28 Apr 2016 15:18:50 +0000
Subject: Bug #72119 [Opn]: Interface declaration compatibility regression
References: 1  Groups: php.standards 
Request: Send a blank email to standards-+get-1080@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72119&edit=1 ID: 72119 Updated by: levim@php.net Reported by: ben dot davies at gmail dot com Summary: Interface declaration compatibility regression Status: Open Type: Bug Package: PHP Language Specification -PHP Version: Next Minor Version +PHP Version: 7.0.6 -Assigned To: +Assigned To: levim Block user comment: N Private report: N New Comment: This was changed in commit e9d65160 by Dmitry. It appears to be a fix for a different bug (71978). Previous Comments: ------------------------------------------------------------------------ [2016-04-28 11:33:37] ben dot davies at gmail dot com Description: ------------ I wanted to raise this against 7.0.6, but it was not available in the list above, despite being released? There seems to be a regression in interface method declaration compatibility checking. The below test script only fails on 7.0.6. It also only fails if the $baz is type hinted as array. Test script: --------------- <?php interface Foo { public function bar(array $baz = null); } class Hello implements Foo { public function bar(array $baz = []) { } } Expected result: ---------------- N/A Actual result: -------------- Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(array $baz = NULL) in /in/VhEtd on line 7 Process exited with code 255. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72119&edit=1

« previous php.standards (#1080) next »