|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-18 09:44 UTC] laruence@php.net
[2012-04-18 09:50 UTC] laruence@php.net
[2012-04-18 10:16 UTC] laruence@php.net
[2012-04-18 10:17 UTC] laruence@php.net
[2012-04-18 10:18 UTC] laruence@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: laruence
[2012-04-18 10:18 UTC] laruence@php.net
[2014-10-07 23:26 UTC] stas@php.net
[2014-10-07 23:37 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
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.