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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: MichaelGlazer at quickenloans dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 23:01:33 2025 UTC