Req #76797 [Wfx]: Ability to access php compiler (deprecated create_function)

From: Date: Tue, 13 Nov 2018 21:21:22 +0000
Subject: Req #76797 [Wfx]: Ability to access php compiler (deprecated create_function)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217945@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76797&edit=1 ID: 76797 User updated by: mageia at mokraemer dot de Reported by: mageia at mokraemer dot de Summary: Ability to access php compiler (deprecated create_function) Status: Wont fix Type: Feature/Change Request Package: *General Issues Operating System: Linux PHP Version: 7.2.9 Block user comment: N Private report: N New Comment: I wanted to say "Throwable" solved it. But I didn't recognize it as a solution, since I'd simplified my code and by doing this there was no error that could be catched. And finally the shutdown function was correctly executed, since the program ends. In real code this does not happen. I was mixing up real code and demo code. Still thank you for your time. Previous Comments: ------------------------------------------------------------------------ [2018-11-13 21:07:55] spam2 at rhsoft dot net don't get me wrong but "Throwable was the solution I didn't see" is a strange response after "same output for Throwable" ------------------------------------------------------------------------ [2018-11-13 19:14:16] mageia at mokraemer dot de sorry, found my mistake in the testcode :( Throwable was the solution I didn't see. Thanks for pointing it out, sorry to bother you. ------------------------------------------------------------------------ [2018-11-13 18:46:24] spam2 at rhsoft dot net it works, period, refactor and simplify your code, you can catch parse errors as any other exception, starzing with PHP7 "Throwable"catches *anything* and if that don't happen you have other problems - this is a bugtracker and not a support forum --------------------------- [harry@srv-rhsoft:/downloads]$ php test.php exception catchedParseError Object ( [message:protected] => syntax error, unexpected end of file [string:Error:private] => [code:protected] => 0 [file:protected] => /mnt/data/downloads/test.php(4) : eval()'d code [line:protected] => 1 [trace:Error:private] => Array ( ) [previous:Error:private] => ) --------------------------- [harry@srv-rhsoft:/downloads]$ cat test.php <?php try { $var = eval('nonsense'); } catch (Throwable $e) { echo 'exception catched'; print_r($e); } ------------------------------------------------------------------------ [2018-11-13 18:29:57] mageia at mokraemer dot de same output for Throwable ------------------------------------------------------------------------ [2018-11-13 18:27:58] spam2 at rhsoft dot net because your code is simply wrong catch(Throwable $e) { } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=76797 -- Edit this bug report at https://bugs.php.net/bug.php?id=76797&edit=1

« previous php.bugs (#217945) next »