php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37033 dechex returns 64-bit hex value
Submitted: 2006-04-10 19:36 UTC Modified: 2006-04-10 19:49 UTC
From: mr dot wiseman at gmail dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.1.2 OS: Ubuntu Breezy on AMD64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mr dot wiseman at gmail dot com
New email:
PHP Version: OS:

 

 [2006-04-10 19:36 UTC] mr dot wiseman at gmail dot com
Description:
------------
The following code will print a 64-bit value on my 64-bit system. As far as I understand all variables are guaranteed to be 32-bit in PHP?

Reproduce code:
---------------
<?php

$a = 0;
echo dechex(~$a);

?>

Expected result:
----------------
ffffffff

Actual result:
--------------
ffffffffffffffff

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-10 19:49 UTC] derick@php.net
You understand wrongly... php's integer size follows the systems integer size.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Sep 08 23:01:28 2024 UTC