ID:               27384
 Updated by:       [EMAIL PROTECTED]
 Reported By:      hayk at mail dot ru
-Status:           Open
+Status:           Closed
 Bug Type:         Unknown/Other Function
 Operating System: Windows 2000
 PHP Version:      4.3.4
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

I see what you're saying now.  This has been fixed in 

HEAD.


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

[2004-02-24 15:42:38] hayk at mail dot ru

Why this code works fine?

<?

        $sp = chr(0x20);

        $a = unpack('C2', $sp.$sp);

?>

<pre>

<? print_r($a); ?>

</pre>

We get:

Array

(

    [1] => 32

    [2] => 32

)

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

[2004-02-24 15:30:15] [EMAIL PROTECTED]

You're not using unpack correctly.  The format string is



Type.Multiplicity.Name



Name cannot begin with or be a number, as it would be 

impossible to distinguish multiplicty from name.

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

[2004-02-24 15:23:26] hayk at mail dot ru

I muddle up "Expected" and "Actual" results in the my submission.

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

[2004-02-24 15:17:55] hayk at mail dot ru

Description:
------------
When the function unpack returns an array with just one element, it
doesn't have an index.



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

        $sp = chr(0x20);

        $a = unpack('C1', $sp);

?>

<pre>

<? print_r($a); ?>

</pre>

Expected result:
----------------
Array

(

    [] => 32

)

Actual result:
--------------
Array

(

    [1] => 32

)


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


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

Reply via email to