note 128257 added to function.eval
| From: | xxixxek at gmail dot com | Date: | Mon, 27 Feb 2023 15:45:19 +0000 |
| Subject: | note 128257 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220215@lists.php.net to get a copy of this message | ||
I happened to work on a very old code that, for many reasons, couldn't be rewritten and the
only way of showing the exact error in eval that worked for me was:
$res = eval($somecode);
if(!$res) {
echo "<pre>";
print_r(explode(PHP_EOL, $somecode));
echo "</pre>";
}
I know it is terrible but I didn't have much of a choice. None of the try...catch solutions
worked for me; the solution above shows the exact lines with numbers and it is easy to find
what's wrong with the code.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 5.158.230.234)
----
Manual Page -- https://php.net/manual/en/function.eval.php
Edit -- https://main.php.net/note/edit/128257
Del: integrated -- https://main.php.net/note/delete/128257/integrated
Del: useless -- https://main.php.net/note/delete/128257/useless
Del: bad code -- https://main.php.net/note/delete/128257/bad+code
Del: spam -- https://main.php.net/note/delete/128257/spam
Del: non-english -- https://main.php.net/note/delete/128257/non-english
Del: in docs -- https://main.php.net/note/delete/128257/in+docs
Del: other reasons-- https://main.php.net/note/delete/128257
Reject -- https://main.php.net/note/reject/128257
Search -- https://main.php.net/manage/user-notes.php