possible switch() bug in 4.0.6 ?
| From: | Chris Lee | Date: | Thu, 02 Aug 2001 21:53:44 +0000 |
| Subject: | possible switch() bug in 4.0.6 ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-61002@lists.php.net to get a copy of this message | ||
4.0.6 apxs
warning = E_ALL;
<?
switch($search)
{
case 'date':
echo 'date';
break;
case 'people':
echo 'people';
break;
case 'keyword':
echo 'keyword';
break;
default:
echo 'default';
break;
}
?>
Warning: Undefined variable: search in
/home/httpd/vhosts/mediawaveonline/test2.php on line 4
Warning: Undefined variable: search in
/home/httpd/vhosts/mediawaveonline/test2.php on line 7
Warning: Undefined variable: search in
/home/httpd/vhosts/mediawaveonline/test2.php on line 10
if you ask me, I should get a warning on line 2 where the switch is, not on
4, 7, 10 where the case statements are.
php 4.0.5 cgi does not do this.
--
Chris Lee
lee@mediawaveonline.com