php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64733 handling large int does not work according to documentation
Submitted: 2013-04-29 09:04 UTC Modified: 2013-04-29 11:59 UTC
From: ludko2 at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.4.14 OS: win7 64bit
Private report: No CVE-ID: None
 [2013-04-29 09:04 UTC] ludko2 at gmail dot com
Description:
------------
handling large int does not work according to documentation:

(Tested on 5.4.6)

Example from documentation: http://php.net/manual/en/language.types.integer.php

$large_number = 9223372036854775807;
var_dump($large_number);                     // int(9223372036854775807)


If this is expected behavior, please update documentation to specify it more clearly.

Please note that converting all integer values to string with number_format function is quite time and code consuming..

Test script:
---------------
$large_number = 9223372036854775807;
var_dump($large_number);                     // int(9223372036854775807)

Expected result:
----------------
int(9223372036854775807)

Actual result:
--------------
float(9.2233720368548E+18)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-29 11:59 UTC] cataphract@php.net
-Status: Open +Status: Not a bug
 [2013-04-29 11:59 UTC] cataphract@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The documentation is clear in that this is platform dependent behavior.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC