PHP 4.0 Bug #4150: unpack ("H4","AB") is not enough input?
| From: | sagawa at sohgoh dot net | Date: | Sat, 15 Apr 2000 11:43:28 +0000 |
| Subject: | PHP 4.0 Bug #4150: unpack ("H4","AB") is not enough input? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17926@lists.php.net to get a copy of this message | ||
From: sagawa@sohgoh.net
Operating system: Windows 95
PHP version: 4.0 Release Candidate 1
PHP Bug Type: Misbehaving function
Bug description: unpack ("H4","AB") is not enough input?
<?php
print pack("H4", "4142"); // this prints "AB"
?>
So I do
<?php
$foo = unpack("H4", "AB");
?>
But, it appeared that
<b>Fatal error</b>: pack type H: not enough input, need 4, have 2 in
<b>-</b> on line <b>2</b><br>
I can this by using bin2hex function to do this.
But Perl works without error,
is this right unpack() behavior?
Thank you.
Akihiro SAGAWA