ID:               35794
 Updated by:       [EMAIL PROTECTED]
 Reported By:      reboot at gmx dot ch
-Status:           Open
+Status:           Feedback
 Bug Type:         Strings related
 Operating System: Linux
 PHP Version:      4.4.1
 New Comment:

You're knowingly consuming all the memory available.
How exactly PHP should understand that you meant something else?


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to