Bug #12554 Updated: switch() bug

From: Date: Fri, 03 Aug 2001 15:42:34 +0000
Subject: Bug #12554 Updated: switch() bug
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-61979@lists.php.net to get a copy of this message
ID: 12554 Updated by: andy Reported By: lee@mediawaveonline.com Status: Open Old Bug Type: Scripting Engine problem Bug Type: Feature/Change Request Operating System: linux PHP Version: 4.0.6 New Comment: reclassified (This is not a "bug") Previous Comments: ------------------------------------------------------------------------ [2001-08-03 10:15:28] lee@mediawaveonline.com <? 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 ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12554&edit=1

« previous php.dev (#61979) next »