Anonymous | Login | Signup for a new account | 12-17-2024 08:35 PST |
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 | ||||
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 | ||||||
Status | closed | Product 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. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |