Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3199 | minor | always | 12-28-08 13:37 | 12-29-08 10:33 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 4.0.0 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.0 | ||
|
|||||
Summary: | 0003199: Static array passed as argument to function in another file loses copy-on-write in compiled mode | ||||
Description: |
lookup.php: <?php function lookup($arr, $idx) { return $arr[$idx]; } test.php: <?php include_once 'lookup.php'; class Foo { public $attrs = array(); public function gimme() { static $val = array('x' => array()); $this->attrs['x'] = lookup($val, 'x'); } } $foo = new Foo(); $foo->gimme(); print "Before: "; print_r($foo->attrs); print " \n"; $foo->attrs['x'][] = 'z'; $foo = new Foo(); $foo->gimme(); print "After: "; print_r($foo->attrs); Regular PHP, and Quercus in interpreted mode, prints Before: Array ( [x] => Array ( ) ) After: Array ( [x] => Array ( ) ) Quercus in compiled mode prints Before: Array ( [x] => Array ( ) ) After: Array ( [x] => Array ( [0] => z ) ) If you move the function to the same source file as the test, the problem goes away. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|