ID: 35794 Updated by: [EMAIL PROTECTED] Reported By: reboot at gmx dot ch -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Linux PHP Version: 4.4.1 New Comment:
There are 1000 and 1 other ways too to consume all the available memory. Just don't do it. Previous Comments: ------------------------------------------------------------------------ [2005-12-24 20:21:53] reboot at gmx dot ch Using -INF as the length of the target string is always impossible. I think this value should not be accepted instead of trying to allocate this much memory. And there still remains the problem that PHP silently terminates the script without printing an error. I only found the reason why my script dies in the apache log. ------------------------------------------------------------------------ [2005-12-24 16:22:39] [EMAIL PROTECTED] You're knowingly consuming all the memory available. How exactly PHP should understand that you meant something else? ------------------------------------------------------------------------ [2005-12-24 16:14:29] reboot at gmx dot ch Description: ------------ str_pad should check it's parameters. With wrong parameters it is possible to cause an out of memory error. This problem also sometimes causes the PHP script to die completely and only leave an error in the apache error log, no out of memory error is reported by PHP. Reproduce code: --------------- <? str_pad("", log10(0), " "); ?> Expected result: ---------------- Warning or error reported by PHP about wrong usage of str_pad for better debugging, not just an our of memory error or silent death of the PHP script. Actual result: -------------- Error in the apache log: Allowed memory size of 8388608 bytes exhausted (tried to allocate 10 bytes) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35794&edit=1