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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fernandokts at msn dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC