PHP 4.0 Bug #7539 Updated: switch statement only process first 7 cases and default

From: Date: Tue, 31 Oct 2000 00:10:02 +0000
Subject: PHP 4.0 Bug #7539 Updated: switch statement only process first 7 cases and default
Groups: php.dev 
Request: Send a blank email to php-dev+get-36502@lists.php.net to get a copy of this message
ID: 7539 Updated by: torben Reported By: razno@siteop.org Status: Closed Bug Type: Unknown/Other Function Assigned To: Comments: This is not a bug in PHP--you're using octal numbers, (an integer prefixed with a 0 is octal in PHP). Since octal digits only go up to 07, you're hitting the ceiling there. Remove the 0's from the beginnings of the numbers and it should work as you expect. Previous Comments: --------------------------------------------------------------------------- [2000-10-30 19:01:36] razno@siteop.org #### EXAMPLE: switch ($rubrika) { case 01: $rubrika = "showbiz"; break; case 02: $rubrika = "politika"; break; case 03: $rubrika = "sport"; break; case 04: $rubrika = "avto"; break; case 05: $rubrika = "zabava"; break; case 06: $rubrika = "ljubezen"; break; case 07: $rubrika = "zdravje"; break; case 08: $rubrika = "znanost"; break; case 09: $rubrika = "racunalnistvo"; break; default: $rubrika = "racunalnistvo"; } #### PHP COMPILE LINE ./configure --with-apache=../apache_1.3.12 --enable-track-vars --with-mysql --with-gdlib --with-imap=/test/imap-4.7b/c-client --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7539

« previous php.dev (#36502) next »