php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7539 switch statement only process first 7 cases and default
Submitted: 2000-10-30 19:01 UTC Modified: 2000-10-30 19:10 UTC
From: razno at siteop dot org Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.3pl1 OS: Redhat 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: razno at siteop dot org
New email:
PHP Version: OS:

 

 [2000-10-30 19:01 UTC] razno at siteop dot 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-30 19:10 UTC] torben@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC