Bug #15154 Updated: set_error_handler(): some parse errors not caught

From: Date: Tue, 22 Jan 2002 20:47:54 +0000
Subject: Bug #15154 Updated: set_error_handler(): some parse errors not caught
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-77829@lists.php.net to get a copy of this message
ID: 15154 Comment by: J.Kolakowski@students.mimuw.edu.pl Reported By: J.Kolakowski@students.mimuw.edu.pl Status: Bogus Bug Type: Scripting Engine problem Operating System: PLD Linux 2.4.16 PHP Version: 4.0CVS-2002-01-21 New Comment: Sorry, my mistake. It prints "Warning: Use of undefined constant ..." indeed. And does it mean we just cannot handle any parse errors? Previous Comments: ------------------------------------------------------------------------ [2002-01-22 15:33:16] mfischer@php.net It's unclear to me how you can reproduce a parser error: $ ~/php/4.1.1/bin/php -q <? error_reporting(E_ALL); i_am_some_parse_error ?> <br> <b>Warning</b>: Use of undefined constant i_am_some_parse_error - assumed 'i_am_some_parse_error' in <b>-</b> on line <b>4</b><br> I tested both 4.1.1 and CVS cgi. Where you using the CLI version? ------------------------------------------------------------------------ [2002-01-22 13:54:19] J.Kolakowski@students.mimuw.edu.pl If the first one is not an parse error, why do I see "Parse error: parse error in ... on line ..." when I run the code without calling set_error_handler()? Are there any parse errors that are caught by an error handler? ------------------------------------------------------------------------ [2002-01-21 22:31:32] mfischer@php.net The first one is a runtime warning (Use of undefined constant ...) and not an parser error. ------------------------------------------------------------------------ [2002-01-21 18:52:57] J.Kolakowski@students.mimuw.edu.pl Some parse errors are caught by assigned error handler, and some are not. I use: error_reporting(E_ALL); set_error_handler('my_error_handler'); For example: <?php i_am_some_parse_error ?> is caught by error handler, and: <?php i_am_some_parse_error = 1; ?> is not caught and displays: "Parse error: parse error in ... on line ...". ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=15154&edit=1

« previous php.dev (#77829) next »