PHP 4.0 Bug #5828: PHP crashes with bad syntax in nested switch statements
| From: | ccurtis at aet-usa dot com | Date: | Fri, 28 Jul 2000 03:32:22 +0000 |
| Subject: | PHP 4.0 Bug #5828: PHP crashes with bad syntax in nested switch statements | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-26652@lists.php.net to get a copy of this message | ||
From: ccurtis@aet-usa.com
Operating system: Linux (Debian/Unstable)
PHP version: 4.0.1pl2
PHP Bug Type: Reproduceable crash
Bug description: PHP crashes with bad syntax in nested switch statements
This is just pseudo-code, but it (roughly) crashes PHP:
Function foo()
{ while( 1 )
{ switch( "b" )
{ case "a":
break;
case "b":
if( 1 )
{ switch( "foo" )
{ case "A":
case "B"
break;
default:
return 0;
}
}
}
}
}
The key here is the code:
``
case "A":
case "B"
break;
''
Placing the ``:'' after the B case works normally, but without it PHP crashes (Document
contains no data).
As an aside, statements like this:
if( something )
}
*really* confuse the parser. Instead of getting an error here, I get undefined function errors,
which is really misleading.
regards,
Christopher