Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2543 | major | always | 03-20-08 18:50 | 03-21-08 13:19 | |
|
|||||
Reporter: | ckchris | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.5 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.6 | ||
|
|||||
Summary: | 0002543: Assignment not working properly? | ||||
Description: |
This is a direct copy of a function code from phpbb3's includes/functions_content.php, part of the class bitfield: function set($n) { $byte = $n >> 3; $bit = 7 - ($n & 7); if (strlen($this->data) >= $byte + 1) { resin_debug("bit val: " . ord(chr(96) | chr(1))); $vall = $this->data[$byte] | chr(1 << $bit); resin_debug("ord: " . ord($vall)); //$this->data[$byte] = $this->data[$byte] | chr(1 << $bit); $this->data[$byte] = $vall; resin_debug(ord($this->data[$byte])); } else { $this->data .= str_repeat("\0", $byte - strlen($this->data)); $this->data .= chr(1 << $bit); } } I have sprinkled some resin debug statements for testing. Input values are: 1, 2, 7 Output of debugging is: [2008/03/20 19:41:02.899] INFO [com.caucho.quercus.lib.MiscModule] bit val: 97 [2008/03/20 19:41:02.900] INFO [com.caucho.quercus.lib.MiscModule] ord: 96 [2008/03/20 19:41:02.901] INFO [com.caucho.quercus.lib.MiscModule] 64 [2008/03/20 19:41:02.901] INFO [com.caucho.quercus.lib.MiscModule] bit val: 97 [2008/03/20 19:41:02.902] INFO [com.caucho.quercus.lib.MiscModule] ord: 65 [2008/03/20 19:41:02.903] INFO [com.caucho.quercus.lib.MiscModule] 64 [2008/03/20 19:41:02.899] INFO [com.caucho.quercus.lib.MiscModule] bit val: 97 [2008/03/20 19:41:02.900] INFO [com.caucho.quercus.lib.MiscModule] ord: 96 [2008/03/20 19:41:02.900] INFO [com.caucho.quercus.lib.MiscModule] 64 [2008/03/20 19:41:02.901] INFO [com.caucho.quercus.lib.MiscModule] bit val: 97 [2008/03/20 19:41:02.902] INFO [com.caucho.quercus.lib.MiscModule] ord: 65 [2008/03/20 19:41:02.903] INFO [com.caucho.quercus.lib.MiscModule] 64 So here's the strange thing. the output of the second statement with "ord: 65" shows the correct value. Yet, when $vall is assigned to $this->data[$byte], the value changed. Is there an assignment problem here? |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|