php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11060 64 bit integer support
Submitted: 2001-05-23 13:28 UTC Modified: 2006-11-11 01:45 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (100.0%)
From: ctebah at galeb dot etf dot bg dot ac dot yu Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: various flavors of Linux, Window
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 12 = ?
Subscribe to this entry?

 
 [2001-05-23 13:28 UTC] ctebah at galeb dot etf dot bg dot ac dot yu
There is some kind of 64 bit integers support, isn't it? I tried this code on several machines running on windows and linux platforms, and it produces the same results:

ex. 1:
for ($i=0; $i < 64; $i++) 
  echo "<br>$i - " . (1 << $i);

doing just fine with 31 bit, so $i must be 32 signed integer, but...

ex. 2:
for ($j=1, $i=0; $i < 64; $i++, $j*=2) 
  echo "<br>$i - $j";

seems to work fine until $j is less than 15 digits long (2^47), for example you may add echo $j % 10 and it would display -8 for each $i >= 47. But, then again...

ex. 3:
$arr = str_pad("1", 64, "0");
$y = mysql_fetch_object(mysql_query("SELECT CONV('$arr', 2, 10) AS xx"));
echo $y->xx;

works just fine, as the $y->xx is unsigned 64 bit integer? But I must admit, this is a silly workaround... 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-11 01:45 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC