Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] 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  
Status closed   Product Version 4.0.0
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.
Additional Information
Attached Files

- Relationships

- Notes
(0003723)
ferg
01-12-09 18:37

php/0249, php/3249
 

- Issue History
Date Modified Username Field Change
01-06-09 23:29 koreth New Issue
01-07-09 10:35 nam Priority normal => urgent
01-07-09 11:00 nam Status new => assigned
01-07-09 11:00 nam Assigned To  => nam
01-07-09 12:24 nam Assigned To nam =>
01-07-09 12:24 nam Status assigned => new
01-12-09 18:37 ferg Note Added: 0003723
01-12-09 18:37 ferg Assigned To  => ferg
01-12-09 18:37 ferg Status new => closed
01-12-09 18:37 ferg Resolution open => fixed
01-12-09 18:37 ferg Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker