php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12737 index bug concerning "00" and "08"
Submitted: 2001-08-14 06:03 UTC Modified: 2001-08-14 06:26 UTC
From: mwijnen at cs dot uu dot nl Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.0.5 OS: Linux 2.2.19 #10 SMP i686
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 34 = ?
Subscribe to this entry?

 
 [2001-08-14 06:03 UTC] mwijnen at cs dot uu dot nl
Using 0 padded integers as index for an array:
	- does not work for 0 and 8
	- scrambles the order of the elements

-------
$a[00] = "string0";
$a[01] = "string1";
$a[02] = "string2";
$a[03] = "string3";
$a[04] = "string4";
$a[05] = "string5";
$a[06] = "string6";
$a[07] = "string7";
$a[08] = "string8";
$a[09] = "string9";

echo implode(";", $a);
--------

This yields:

string9;string1;string2;string3;string4;string5;string6;string7

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-14 06:26 UTC] derick@php.net
Not a bug, 09 is interpreted as octal, and octal 08/09 does not exist.

Derick
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 01:01:26 2019 UTC