Anonymous | Login | Signup for a new account | 10-03-2024 02:58 PDT |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003199 | [Quercus] | minor | always | 12-28-08 13:37 | 12-29-08 10:33 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 4.0.0 | Product Version | 4.0.0 | ||||
Product Build | |||||||||
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 | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |