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
 [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

Add a Patch

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-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 09 20:05:45 2022 UTC