Date: 12/08/00
- Next message: Adam Trachtenberg: "Re: [PHP-DEV] PHP 4.0 Bug #8180: Multiple "else" clauses in an "if" statement do not generate an error"
- Previous message: greg <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180: Multiple "else" clauses in an "if" statement do not generate an error"
- Next in thread: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180 Updated: Multiple "else" clauses in an "if" statement do not generate an error"
- Maybe reply: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180 Updated: Multiple "else" clauses in an "if" statement do not generate an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 8180
Updated by: sniper
Reported By: greg <email protected>
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Assigned To:
Comments:
This works just like it should, generates a parse error for me.
(I'm using the latest CVS)
Check your php.ini:
error_reporting = E_ALL
if it is something else, try changing to E_ALL.
And if it still doesn't generate an error, try PHP4.0.4RC4:
http://www.php.net/distributions/php-4.0.4RC4.tar.gz
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-12-08 19:23:27] greg <email protected>
The following script does not generate a parse error, and results in either zero output (an empty document), or a skeletal HTML document unrelated to the desired output (see below).
Sample script
----------------------------------------------
<?php
if ( 1 ) {
print("1");
} else {
print("2");
} else {
print("3");
}
?>
----------------------------------------------
Weird HTML output
----------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
----------------------------------------------
(note: this HTML output is unrelated to any code in the php file. It appears to be coming from the script engine itself?)
The expecetd behavior would be that an error is generated by the script engine. This proved to be an irritating bug to track down on a fairly complex page with multiple nested "if" statements, since no error was reported and no content was generated.
One other note, this same sample file generates a parse error on our FreeBSD box running PHP 4.0.2.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8180
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Adam Trachtenberg: "Re: [PHP-DEV] PHP 4.0 Bug #8180: Multiple "else" clauses in an "if" statement do not generate an error"
- Previous message: greg <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180: Multiple "else" clauses in an "if" statement do not generate an error"
- Next in thread: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180 Updated: Multiple "else" clauses in an "if" statement do not generate an error"
- Maybe reply: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #8180 Updated: Multiple "else" clauses in an "if" statement do not generate an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

