note 128258 added to function.eval

From: Date: Mon, 27 Feb 2023 15:46:05 +0000
Subject: note 128258 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-220216@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/128258 Del: integrated -- https://main.php.net/note/delete/128258/integrated Del: useless -- https://main.php.net/note/delete/128258/useless Del: bad code -- https://main.php.net/note/delete/128258/bad+code Del: spam -- https://main.php.net/note/delete/128258/spam Del: non-english -- https://main.php.net/note/delete/128258/non-english Del: in docs -- https://main.php.net/note/delete/128258/in+docs Del: other reasons-- https://main.php.net/note/delete/128258 Reject -- https://main.php.net/note/reject/128258 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220216) next »