Anonymous | Login | Signup for a new account | 12-17-2024 11:39 PST |
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 | ||||
0003225 | [Quercus] | major | always | 01-06-09 23:29 | 01-12-09 18:37 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | urgent | 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 | 0003225: Method static is getting reset | ||||||||
Description |
I haven't been able to isolate this, so no self-contained test case for this one, but we have the following code: class ABC { ... public static function getResponse() { static $response = null; if ($response === null) { error_log('Making new response'); $response = new ABCResponse(); } return $response; } This is supposed to return a singleton instance of ABCResponse, and it does in regular PHP. But in Quercus -- and I believe this is a recent behavior change, though I don't know exactly when it changed -- I see the "Making new response" log message twice in a single request. However, this method is called more than twice, so the static variable is not *always* getting reset. If it matters, one of the calls to this that causes the log message is from a non-static method of another class, while the other is from a function. This class, the other class, and the function are all in separate source files. But that set of conditions alone doesn't seem to be sufficient to trigger the bug. This class has no subclasses. |
||||||||
Steps To Reproduce | |||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 27 unique queries executed. |