#28330 [Opn]: include with parse error kills script

From: Date: Sun, 09 May 2004 11:19:05 +0000
Subject: #28330 [Opn]: include with parse error kills script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59417@lists.php.net to get a copy of this message
ID: 28330 User updated by: microcamers at hotmail dot com Reported By: microcamers at hotmail dot com Status: Open Bug Type: *General Issues Operating System: Windows XP PHP Version: 5CVS-2004-05-09 (dev) New Comment: Description: ------------ I just upgraded to the latest snapshot and now find that Parse Errors stop the excecution of the script with an error. So now i have the choice between displaying no error as to whats happened and a blank page coming up, or displaying an ugly php error telling the user things about my files, because i cannot catch parse errors with php's error handling functions. Reproduce code: --------------- if(!@include("file_with_parse_error.php")){ die("There has been a problem generating this page"); } Expected result: ---------------- If the file had a parse error or didnt exist, it would die with that error. Or even better i could have it email me. Actual result: -------------- Now it just prints "Parse error: parse error, unexpected ..." even though i have put the @ symbol before it. It also gets through output buffering. Previous Comments: ------------------------------------------------------------------------ [2004-05-09 09:26:29] vkatragadda at email dot com hello, i think that the fault exists in your script. if you copied these lines directly, then your missing a right bracket if(!@include("file_with_parse_error.php"){ should be if(!@include("file_with_parse_error.php")){ i just spotted this and didn't run the script as i'm having a problem with windoze.. sorry if this is wasting your time :) ------------------------------------------------------------------------ [2004-05-09 03:41:31] microcamers at hotmail dot com Description: ------------ I just upgraded to the latest snapshot and now find that Parse Errors stop the excecution of the script with an error. So now i have the choice between displaying no error as to whats happened and a blank page coming up, or displaying an ugly php error telling the user things about my files, because i cannot catch parse errors with php's error handling functions. Reproduce code: --------------- if(!@include("file_with_parse_error.php"){ die("There has been a problem generating this page"); } Expected result: ---------------- If the file had a parse error or didnt exist, it would die with that error. Or even better i could have it email me. Actual result: -------------- Now it just prints "Parse error: parse error, unexpected ..." even though i have put the @ symbol before it. It also gets through output buffering. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28330&edit=1

« previous php.bugs (#59417) next »