php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27311 array values are ignored wheb beginning with a 0 number
Submitted: 2004-02-18 09:53 UTC Modified: 2004-02-18 10:19 UTC
From: MichaelGlazer at quickenloans dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.4 OS: winxp
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:
15 + 5 = ?
Subscribe to this entry?

 
 [2004-02-18 09:53 UTC] MichaelGlazer at quickenloans dot com
Description:
------------
Creating an array with hardcoded number values beginning with a number 0 does not save anything beyond the 0.

This is when done outside of any quotes, single or double.

It works fine when quotes are added to these numbers.

Reproduce code:
---------------
$a=array(
	1980,
	0891
);

print_r($a);

Expected result:
----------------
Array
        (
            [0] => 1980
            [1] => 0891
        )



Actual result:
--------------
Array
        (
            [0] => 1980
            [1] => 0
        )



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-18 10:19 UTC] mgf@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 beginning with 0 are taken as octal. 8 and 9 are not valid octal digits, so 0891 is not actually a valid number.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 17:01:31 2024 UTC