note 130175 added to function.set-error-handler
| From: | regslask@protonmail.com | Date: | Wed, 19 Mar 2025 13:49:02 +0000 |
| Subject: | note 130175 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-222007@lists.php.net to get a copy of this message | ||
Usually, this method is not called in a loop, but if it is, there is one thing that may be EXTREMELY
important to think of, and that is to run
restore_error_handler() once for each call to
set_error_handler. Otherwise, you will have a memory leak. Every time set an error
handler, even if it's identical to the previous one, you're pushing the previous one to a
stack.
We recently had a big crash due to this, and we had a very hard time finding out what the problem
was. There was no error message or anything. Just a big crash.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 213.115.8.221)
----
Manual Page -- https://php.net/manual/en/function.set-error-handler.php
Edit -- https://main.php.net/note/edit/130175
Del: integrated -- https://main.php.net/note/delete/130175/integrated
Del: useless -- https://main.php.net/note/delete/130175/useless
Del: bad code -- https://main.php.net/note/delete/130175/bad+code
Del: spam -- https://main.php.net/note/delete/130175/spam
Del: non-english -- https://main.php.net/note/delete/130175/non-english
Del: in docs -- https://main.php.net/note/delete/130175/in+docs
Del: other reasons-- https://main.php.net/note/delete/130175
Reject -- https://main.php.net/note/reject/130175
Search -- https://main.php.net/manage/user-notes.php