note 58496 added to function.eval

From: Date: Sun, 06 Nov 2005 12:08:47 +0000
Subject: note 58496 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-98152@lists.php.net to get a copy of this message
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 :) ---- Manual Page -- http://www.php.net/manual/en/function.eval.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58496 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58496&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58496&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98152) next »