|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48422 Math sum error
Submitted: 2009-05-28 22:44 UTC Modified: 2009-05-29 10:20 UTC
From: fernandokts at msn dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.2.9 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: fernandokts at msn dot com
New email:
PHP Version: OS:


 [2009-05-28 22:44 UTC] fernandokts at msn dot com
When doing simple math, there is a problem with numbers with 2 digits greater then 07 in sums.
It appears to ignore any numbers starting with a zero that are bigger then 07.

Reproduce code:
$calc = 01 + 03 + 05 + 06 + 07 + 08;
echo "The result is: $calc";

Expected result:
The result is: 30

Actual result:
The result is: 22


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-28 23:27 UTC]
You have discovered octal numbers.  Not a bug.
 [2009-05-29 10:20 UTC]
08 = 0... octal numbers.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Oct 05 15:05:52 2022 UTC