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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 8 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 05:01:28 2024 UTC