[PHP-BUG] Bug #51547 [NEW]: Type casting from int to int after log changes value

[email protected] ("acollins at liv dot ac dot uk") Tue, 13 Apr 2010 11:03:33 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
From:             
Operating system: 
PHP version:      5.2.13
Package:          *Math Functions
Bug Type:         Bug
Bug description:Type casting from int to int after log changes value

Description:
------------
When performing a log(), and immediately type casting afterwards, the value
changes.

Test script:
---------------
<?php
$val = 1000;
echo log($val, 10) .' == '. (int) log($val, 10);
?>

Expected result:
----------------
3 == 3

Actual result:
--------------
3 == 2

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51547&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51547&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51547&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51547&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51547&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51547&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51547&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51547&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51547&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51547&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51547&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51547&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51547&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51547&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51547&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51547&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51547&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51547&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51547&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51547&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51547&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51547&r=mysqlcfg