php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60086 leading zeros used in array gives problems
Submitted: 2011-10-18 13:45 UTC Modified: 2011-10-18 15:03 UTC
From: bartdeliefde at gmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
 [2011-10-18 13:45 UTC] bartdeliefde at gmail dot com
Description:
------------
leading zeros used in arrays gives problems
.

Test script:
---------------
<?php

	$a="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
    
	$array_alphabet = array();
	$array_alphabet = explode(",",$a);
    
	echo $array_alphabet[09]; 
//gives me the first element instead of the tenth, $array_alphabet[9] works fine
	
    
?>


Expected result:
----------------
echo $array_alphabet[09];  expected to give me 'j'

Actual result:
--------------
but is gives me 'a'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-18 15:03 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2011-10-18 15:03 UTC] cataphract@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Leading zeros are for octal notation.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 17:01:24 2021 UTC