|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38548 intval rounds to nearest int
Submitted: 2006-08-22 17:25 UTC Modified: 2006-08-22 17:52 UTC
From: tstarling at wikimedia dot org Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.4.4 OS: Linux
Private report: No CVE-ID: None
 [2006-08-22 17:25 UTC] tstarling at wikimedia dot org
We have a report on that in PHP 4.4.3 on linux, integer conversion rounds to the nearest integer. This is a change from the previous behaviour, according to the manual and in previous versions of PHP, integer conversion rounds down. I don't see anything about this in the changelog, so I'm assuming the problem persists in 4.4.4. 

Reproduce code:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-22 17:50 UTC]
# php -r 'var_dump(intval(0.9));'
# php -v
PHP 4.4.5-dev (cli) (built: Aug 22 2006 21:48:33) (DEBUG)

Same result with 4.4.4, 4.4.3 and others.
Obviously such change could not happen, 'cause it would break lots of tests.

 [2006-08-22 17:51 UTC] tstarling at wikimedia dot org
I couldn't confirm this personally, I tried a new build of 4.4.3 and 4.4.4 on linux, but didn't see the bug on either. Perhaps someone here has an idea about how to reproduce it?
 [2006-08-22 17:52 UTC]
>Perhaps someone here has an idea about how to reproduce it?
I guess you should ask the person who originally reported it.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 17 17:05:44 2022 UTC