From: Operating system: Windows 7 Prof x64 PHP version: 5.4.0 Package: Reproducible crash Bug Type: Bug Bug description:'Overriding' a private static method with a different signature causes crash
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 bug report at https://bugs.php.net/bug.php?id=61761&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61761&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61761&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61761&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61761&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61761&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61761&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61761&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61761&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61761&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61761&r=support Expected behavior: https://bugs.php.net/fix.php?id=61761&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61761&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61761&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61761&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61761&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61761&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61761&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61761&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61761&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61761&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61761&r=mysqlcfg