note 58496 deleted from function.eval by sniper

From: Date: Thu, 29 Dec 2005 09:15:54 +0000
Subject: note 58496 deleted from function.eval by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100919@lists.php.net to get a copy of this message
Note Submitter: ---- comment on note: james.taylor at stealthnet dot net 10-Feb-2005 10:46 Not all parse errors are uncatchable when found in eval()'ed code. There are "minor" and "major" parse errors - eg. if you forgot ';' on the end of line, you will get minor error that simply generates error message appended to output, and you can catch them by ob_start/ob_get_clean and then ereg()'ing the result for eg. '\<b\>Parse error:'. But "major" errors, like using not existing function or class really seem not catchable, neither via try/catch, standard error reporting, @, output buffering nor whatever i thought of.. I'd really like to see it could be done, because I tried to make some better error reporting than message "error was in evaled code that was evaled in {file}", damn, at least it could print the faulty line of the code that was evaled.. But there is no way of catching death of the compiler, sorry :)

« previous php.notes (#100919) next »