| Anonymous | Login | Signup for a new account | 06-10-2026 06:09 PDT |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0004568 | [Quercus] | major | always | 05-20-11 10:56 | 12-30-12 00:17 | ||||
| Reporter | thr | View Status | public | ||||||
| Assigned To | domdorn | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 4.0.14 | ||||||
| Summary | 0004568: str_split fails with byte string | ||||||||
| Description |
The application is reading a byte array from disc and trying to spilt it into an array of 8 bytes to unpack it later into int values. split_str returns correct sized array but does not set values after first array. This works in 'native' php (This technique is used in Wordpress 3 to read .mo translation files into memory). |
||||||||
| Additional Information |
<?php $packed = pack("c*", 10,10,10,10,-64,8,1,10,77,2,0,0,63,8,1,0,1,2,3,4,5,6,7,8); print 'md5='.md5($packed).' '; $octets = str_split($packed, 8); for($o = 0; $o < count($octets); $o++) { print ' o='.$o.' '; $unpacked=unpack("c1n1/c1n2/c1n3/c1n4/c1n5/c1n6/c1n7/c1n8", $octets[$o]); var_dump($unpacked); } ?> In Quercus output is: md5=f13234affbcb2464158d99a131d1b001 o=0 array(8) { ["n1"]=> int(10) ["n2"]=> int(10) ["n3"]=> int(10) ["n4"]=> int(10) ["n5"]=> int(-64) ["n6"]=> int(8) ["n7"]=> int(1) ["n8"]=> int(10) } o=1 array(0) { } o=2 array(0) { } Native PHP output is: o=0 array(8) { ["n1"]=> int(10) ["n2"]=> int(10) ["n3"]=> int(10) ["n4"]=> int(10) ["n5"]=> int(-64) ["n6"]=> int(8) ["n7"]=> int(1) ["n8"]=> int(10) } o=1 array(8) { ["n1"]=> int(77) ["n2"]=> int(2) ["n3"]=> int(0) ["n4"]=> int(0) ["n5"]=> int(63) ["n6"]=> int(8) ["n7"]=> int(1) ["n8"]=> int(0) } o=2 array(8) { ["n1"]=> int(1) ["n2"]=> int(2) ["n3"]=> int(3) ["n4"]=> int(4) ["n5"]=> int(5) ["n6"]=> int(6) ["n7"]=> int(7) ["n8"]=> int(8) } |
||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Notes |
|
|
(0005307) domdorn 06-09-11 12:54 |
fixed in current trunk, will be in 4.0.19 Thanks for reporting this bug! php/118e |
|
(0006131) nam 12-30-12 00:17 |
Closing old resolved bugs. |
| Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed. 29 unique queries executed. |