php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25531 Array can't behave.
Submitted: 2003-09-14 09:30 UTC Modified: 2003-09-14 09:36 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: oswald at welho dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: * OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: oswald at welho dot com
New email:
PHP Version: OS:

 

 [2003-09-14 09:30 UTC] oswald at welho dot com
Description:
------------
Array can't fetch data with certain keys. No changes made in any important file. Tested also with version 4.3.2, same result.

Reproduce code:
---------------
$a = array('nothing', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12');
$b = $a[7];
$c = $a[07];
$d = $a[8];
$e = $a[08];
$f = $a[9];
$g = $a[09];
$h = $a[10];
$i = $a[10];
print("$b = $c, $d = $e, $f = $g, $h = $i"); // The print should be 7=7, 8=8, 9=9, 10=10 but no.

Expected result:
----------------
Array can't fetch data when key is 08 or 09. But when key is 07 or 10 it can. With numbers 7,8,9 and 10 it works nicely. If this behaviour is completely normal please feel free to send some insults to me.

Actual result:
--------------
Result is nothing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-14 09:36 UTC] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Numbers starting with '0' denote octal values. And therefore of course 08 and 09 are invalid.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 00:01:27 2024 UTC