php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33969 No out
Submitted: 2005-08-02 17:02 UTC Modified: 2005-08-02 17:08 UTC
From: webmaster at ebv dot com dot br Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.11 OS: case
Private report: No CVE-ID: None
 [2005-08-02 17:02 UTC] webmaster at ebv dot com dot br
Description:
------------
case no out 08 and 09

O Case n?o retorna! 08 e 09




Reproduce code:
---------------
echo $atemes = '08';
switch($atemes) {
case 01:
echo $messql2 = 'Jan';
break;
case 08:
echo $messql2 = 'Aug';
break;
case 09:
echo $messql2 = 'Sep';
break;
  }

Expected result:
----------------
case "01" ok             --- "01" or "1"  
case "02" ok
...
case "08" beeeeeee! NO!! (case 8  ok) --> 08 no  8 yes (only)
case "09" beeeeeee! NO!! (case 9  ok) --> 09 no  9 yes (only)
case "10" ok
...



Actual result:
--------------
echo "mes 1 ".$messql."<br>";
echo "atmes ".$atemes."<br>";
echo $atemes = '08';
switch($atemes) {
case 01:
echo $messql2 = 'Jan';
break;
case 8:
echo $messql2 = 'Aug';
break;
case 9:
echo $messql2 = 'Sep';
break;
  }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-02 17:08 UTC] rasmus@php.net
You have discovered octal numbers.  Remove the leading 0's or put qoutes around them to treat them as strings.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC