|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17892 Error Handling for eval()
Submitted: 2002-06-21 04:57 UTC Modified: 2002-06-24 03:00 UTC
From: Sky at quit-clan dot de Assigned:
Status: Duplicate Package: Feature/Change Request
PHP Version: 4.2.1 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: Sky at quit-clan dot de
New email:
PHP Version: OS:


 [2002-06-21 04:57 UTC] Sky at quit-clan dot de
I want to handle Parse_Errors and similar Fatals with my custom error handler when they occur in eval()'d code.

This is necessary when i want to execute custom code in my console script and prevent this code from crashing my entire program if there is only a simple typo in there...

I have achieved this by a little hack in the "zend_execute.c" but i don't know if this handles any errors right that don't occur in eval'd() code...
This is what i changed (to even prevent a segmentation fault) (zend_execute.c, line 1563):

if (zend_hash_find(active_function_table, function_name->value.str.val, function_name->value.str.len+1, (void **) &function)==FAILURE) {
zend_error(E_USER_ERROR, "Call to undefined function: %s()", function_name->value.str.val);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-21 10:45 UTC] Sky at quit-clan dot de
Sorry, of course a parse error is not a fatal error, what i meant was: fatal errors like "call to undefined function".
 [2002-06-24 03:00 UTC]
Duplicate of #13993

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 05:01:29 2023 UTC