Edit report at https://bugs.php.net/bug.php?id=61761&edit=1
ID: 61761 Updated by: larue...@php.net Reported by: hughes dot corbin at gmail dot com Summary: 'Overriding' a private static method with a different signature causes crash -Status: Open +Status: Closed Type: Bug Package: Reproducible crash Operating System: Windows 7 Prof x64 PHP Version: 5.4.0 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-04-18 10:17:38] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=da6465a268d9ece2ffd38447890b206dd94b3250 Log: Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash) ------------------------------------------------------------------------ [2012-04-18 10:16:01] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=da6465a268d9ece2ffd38447890b206dd94b3250 Log: Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash) ------------------------------------------------------------------------ [2012-04-18 09:50:01] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=1bbb5069ff794f812ea0a67bdcbc928cecd0b10a Log: Revert "Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash)" ------------------------------------------------------------------------ [2012-04-18 09:44:51] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=1b29ba61de23f1e4d10472bf5dc1bf1db3f96328 Log: Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash) ------------------------------------------------------------------------ [2012-04-18 07:28:02] hughes dot corbin at gmail dot com Description: ------------ If error_reporting is set to report E_STRICT (any mask involving it being high), then PHP will crash if a private static method is 'overriden' with a different signature. Since the method is private, it is, as far as I know, theoretically valid to override it (and thus it shouldn't even cause a strict warning). However, when overriding it, PHP crashes. I wish I could post a backtrace, but I'm on Windows and don't currently have access to the proper tools. An interesting note: Even linting the test file provided (php -l test.php) will cause the crash. This makes me think that it's in the strict routine that the crash is happening, though that's only speculation. My guess is that PHP starts to flag the strict notice when it sees that the method signatures do not match, and then the private comes into play and makes it crash. (With public or protected visibility there is no crash and the expected strict notice is generated). php.net build of PHP 5.4.0: PHP 5.4.0 (cli) (built: Feb 29 2012 19:24:02) Windows 7 Professional x64 (32 bit version of PHP) Test script: --------------- <?php class A { private static function test($a) { } } class B extends A { private static function test($a, $b) { } } ?> Expected result: ---------------- Nothing. The file should parse correctly. Actual result: -------------- Crashes. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61761&edit=1