Bug #62956 [Asn->Fbk]: "incompatible" signatures for private methods should not cause E_STRICT

From: Date: Tue, 28 Aug 2012 12:14:16 +0000
Subject: Bug #62956 [Asn->Fbk]: "incompatible" signatures for private methods should not cause E_STRICT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172980@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62956&edit=1 ID: 62956 Updated by: lstrojny@php.net Reported by: lsmith@php.net Summary: "incompatible" signatures for private methods should not cause E_STRICT -Status: Assigned +Status: Feedback Type: Bug Package: Unknown/Other Function PHP Version: 5.4.6 Assigned To: lstrojny Block user comment: N Private report: N New Comment: Please try using this snapshot: http://snaps.php.net/php5.4-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2012-08-28 12:12:51] laruence@php.net just skip the inherit method checking for private methods should works ------------------------------------------------------------------------ [2012-08-28 12:01:24] lsmith@php.net appears to be a duplicate of #61761 ------------------------------------------------------------------------ [2012-08-28 11:02:32] lsmith@php.net BTW: A temporary fix is to simply rename the method in the extending class. ------------------------------------------------------------------------ [2012-08-28 10:58:59] lsmith@php.net Description: ------------ Defining a private method in an extending class that matches the name of a private method in a parent class with a different signature currently triggers an E_STRICT. As the extending class shouldn't see the parent private methods, there is no reason to trigger an E_STRICT in this case. Test script: --------------- <?php class A { private function foo($bar) { } } class B extends A { private function foo() { } } Expected result: ---------------- no E_STRICT error Actual result: -------------- PHP Strict standards: Declaration of B::foo() should be compatible with A::foo($bar) in /Users/lsmith/htdocs/foo.php on line 15 Strict standards: Declaration of B::foo() should be compatible with A::foo($bar) in /Users/lsmith/htdocs/foo.php on line 15 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62956&edit=1

« previous php.bugs (#172980) next »