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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Tue Jun 18 10:01:29 2024 UTC