#27384 [NEW]: Function unpack incorrectly works with string with just one char

From: Date: Tue, 24 Feb 2004 20:17:55 +0000
Subject: #27384 [NEW]: Function unpack incorrectly works with string with just one char
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55476@lists.php.net to get a copy of this message
From: hayk at mail dot ru Operating system: Windows 2000 PHP version: 4.3.4 PHP Bug Type: Unknown/Other Function Bug description: Function unpack incorrectly works with string with just one char 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 bug report at http://bugs.php.net/?id=27384&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27384&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27384&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27384&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27384&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27384&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27384&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27384&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27384&r=support Expected behavior: http://bugs.php.net/fix.php?id=27384&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27384&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27384&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27384&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27384&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27384&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27384&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27384&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27384&r=float

« previous php.bugs (#55476) next »