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

From: Date: Tue, 13 Nov 2018 17:29:24 +0000
Subject: Req #76797 [Com]: Ability to access php compiler (deprecated create_function)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217938@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 Comment by: spam2 at rhsoft dot net 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: this is simply not true because with try-catch you have everything you need without the drawback of mangle with the error handler Previous Comments: ------------------------------------------------------------------------ [2018-11-13 17:09:44] requinix@php.net > makes it impossible to check for syntax errors and handle them apropriate! Thank you for reading the documentation, but while the sentence you identified does explain that you can no longer handle parse errors with set_error_handler(), the sentence immediately before it told you the new behavior: > As of PHP 7, if there is a parse error in the evaluated code, eval() throws a > ParseError exception. ------------------------------------------------------------------------ [2018-11-13 17:03:39] mageia at mokraemer dot de I thought eval solves the problem, but it is not. The changed behaviour of eval "Before PHP 7, in this case eval() returned FALSE and execution of the following code continued normally. It is not possible to catch a parse error in eval() using set_error_handler()." makes it impossible to check for syntax errors and handle them apropriate! ------------------------------------------------------------------------ [2018-10-16 23:39:51] mageia at mokraemer dot de sorry, I didn't see your comment. You're right, eval solves my problem. ------------------------------------------------------------------------ [2018-10-16 23:16:53] mageia at mokraemer dot de is there any advice on how to check syntax inside php? For user contributed code, I really want to check the syntax before using the code. ------------------------------------------------------------------------ [2018-08-26 22:47:55] requinix@php.net * https://wiki.php.net/rfc/howto ------------------------------------------------------------------------ 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 (#217938) next »