php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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);
return;
}

Patches

Pull Requests

History

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] sniper@php.net
Duplicate of #13993


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC