ID: 43042 Updated by: [EMAIL PROTECTED] Reported By: thuejk at gmail dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: All PHP Version: 5.2.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php You should use a logfile for error messages. Changing the current behavior would break too many things. Previous Comments: ------------------------------------------------------------------------ [2007-10-19 17:00:33] thuejk at gmail dot com Description: ------------ I have a PHP production setup where errors are automatically reported to me via email, by using a custom error handler. However, when PHP reaches it's memory limit the custom error handler is disabled. As a result, I may not be notified of OOM errors. It would be nice if PHP did one of two things: 1) Emit an E_WARNING the first time the script reaches 99% (or something like that, maybe configurable) of memory_limit. 2) When the program reaches the memory limit the first time, add fx 1MB (perhaps user configurable) to the memory limit, emit an OOM E_WARNING, and let the custom error handler handle the error. The next time the memory limit is reached then really die. I would prefer 1) Reproduce code: --------------- <?php function custom_error_handler($error_code, $error_string, $filename, $line, $symbols) { die("This is the custom error handler"); } set_error_handler('custom_error_handler'); $i = 0; $a = Array(); while (true) { $a[$i] = $i++; } ?> Expected result: ---------------- It would be nice if my custom error handler was allowed to run. Actual result: -------------- [EMAIL PROTECTED] ~/php_oom> php test.php Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 35 bytes) in /home/thue/php_oom/test.php on line 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43042&edit=1
