Bug #66781 [NEW]: Errorneous "Cannot make non static method static in" for private methods

From: Date: Wed, 26 Feb 2014 16:58:59 +0000
Subject: Bug #66781 [NEW]: Errorneous "Cannot make non static method static in" for private methods
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184444@lists.php.net to get a copy of this message
From: maciej dot sz at gmail dot com Operating system: irrelevant PHP version: 5.5.9 Package: Class/Object related Bug Type: Bug Bug description:Errorneous "Cannot make non static method static in" for private methods Description: ------------ Private methods are owned by the classes in which they are used, so there should be no problem with the following code: Test script: --------------- class Foo { private function fooMethod(){} } class Bar extends Foo { private static function fooMethod(){} } Expected result: ---------------- Sounds like the Bar::fooMethod() tries to override the Foo::fooMethod(), even though the Foo::fooMethod() is not a part of the Bar class. They should not affect each other due to private visibility. Actual result: -------------- The test code produces: Fatal error: Cannot make non static method Foo::fooMethod() static in class Bar in /home/www/workspace/tests/static_private_override.php on line 9 -- Edit bug report at https://bugs.php.net/bug.php?id=66781&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66781&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66781&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66781&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66781&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66781&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66781&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66781&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66781&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66781&r=support Expected behavior: https://bugs.php.net/fix.php?id=66781&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66781&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66781&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66781&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66781&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66781&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66781&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66781&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66781&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66781&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66781&r=mysqlcfg

« previous php.bugs (#184444) next »