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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 21 16:01:24 2020 UTC