#48422 [Bgs]: Math sum error

From: Date: Fri, 29 May 2009 10:20:55 +0000
Subject: #48422 [Bgs]: Math sum error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137867@lists.php.net to get a copy of this message
ID: 48422 Updated by: derick@php.net Reported By: fernandokts at msn dot com Status: Bogus Bug Type: Math related Operating System: Linux PHP Version: 5.2.9 New Comment: 08 = 0... octal numbers. Previous Comments: ------------------------------------------------------------------------ [2009-05-28 23:27:33] rasmus@php.net You have discovered octal numbers. Not a bug. ------------------------------------------------------------------------ [2009-05-28 22:44:37] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48422&edit=1

« previous php.bugs (#137867) next »