Return to bug36148.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Bug #36148 (unpack("H*hex", $data) is adding an extra character to the end of the string) 3: --FILE-- 4: <?php 5: $values = array("a", "aa", "aaa", "aaaa"); 6: foreach ($values as $value) { 7: $a = pack("H*", $value); 8: $b = unpack("H*", $a); 9: echo $value.": "; 10: var_dump($b); 11: } 12: ?> 13: --EXPECT-- 14: a: array(1) { 15: [1]=> 16: string(2) "a0" 17: } 18: aa: array(1) { 19: [1]=> 20: string(2) "aa" 21: } 22: aaa: array(1) { 23: [1]=> 24: string(4) "aaa0" 25: } 26: aaaa: array(1) { 27: [1]=> 28: string(4) "aaaa" 29: }