php.net |  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
 [2009-05-28 22:44 UTC] fernandokts at msn dot com
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-28 23:27 UTC] rasmus@php.net
You have discovered octal numbers.  Not a bug.
 [2009-05-29 10:20 UTC] derick@php.net
08 = 0... octal numbers.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Aug 13 09:05:44 2022 UTC