ID:               32700
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      4.3.10
 New Comment:

And it's still not a bug.


Previous Comments:
------------------------------------------------------------------------

[2005-04-13 23:58:32] [EMAIL PROTECTED]

RTFM.. (for pack() function)


------------------------------------------------------------------------

[2005-04-13 23:14:48] [EMAIL PROTECTED]

It has nothing do with "echo showing the signed version." 
If that were the case, it would output the same (negative) 
number when you echo $before as well. 
 
It's PHP /using/ the signed version. For example:    
    
$test[$before] = 'It works!';    
if (isset($test[$after])) {    
    echo "It works!\n";   
} else {   
    echo "It doesn't work!\n";  
}  
  
$before and $after are /not/ the same value to PHP. Nothing 
to do with echo.

------------------------------------------------------------------------

[2005-04-13 23:07:10] [EMAIL PROTECTED]

Yes, but echo will show the signed representatation. This is *not* a
bug, use printf("%u") to show the unsigned version.

------------------------------------------------------------------------

[2005-04-13 23:01:54] [EMAIL PROTECTED]

While PHP may only support signed integers, the manual for 
pack() clearly states, regarding the 'N' format: 
 
"unsigned long (always 32 bit, big endian byte order)" 
 
But it returns a signed int when using this format, 
contrary to the documentation. 
 
There's obviously some sort of internal PHP state regarding 
the signedness of a particular value, since it's capable of 
correctly representing the unsigned value. It just seems 
that unpack() is doing something wrong here.

------------------------------------------------------------------------

[2005-04-13 22:54:41] [EMAIL PROTECTED]

try printf("%u") though to print it - that would work...

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/32700

-- 
Edit this bug report at http://bugs.php.net/?id=32700&edit=1

Reply via email to