php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18921 integer values 08, 09 convert to string as 0
Submitted: 2002-08-15 13:54 UTC Modified: 2002-08-15 13:59 UTC
From: ben at parcelrecords dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.2.2 OS: Windows 2000
Private report: No CVE-ID: None
 [2002-08-15 13:54 UTC] ben at parcelrecords dot com
Ok,
<? echo 01, 02, 03, 04, 05, 06, 07, 08, 09, 10; ?>
prints
12345670010
instead of
12345678910

8 and 9 are now zeroes

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-15 13:59 UTC] zeev@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

integers that begin with leading zeros are treated as octal numbers.  Since 08 and 09 contain digits which are invalid in the octal base, they're reduced to zeros.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 13:01:27 2019 UTC