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
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:
7 + 18 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC