Anonymous | Login | Signup for a new account | 12-17-2024 08:31 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 | ||||
0002550 | [Quercus] | minor | have not tried | 03-24-08 15:47 | 05-12-08 17:19 | ||||
Reporter | mardala | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.1.3 | ||||||
Summary | 0002550: PHP5 singleton example not working the same as Apache module php 5 | ||||||||
Description |
given something like this: class Singleton { // object instance private static $instance; private function __construct() {} public static function getInstance() { if (self::$instance === null) self::$instance = new self; return self::$instance; } public function doAction() { ... } } This will not work. Quercus throws an exception (com.caucho.quercus.QuercusException: no matching class self) on "new self;" ... the fix is "new Singleton();" Not a show stopper by anymeans at all, but just a subtle difference than php on apache. |
||||||||
Additional Information | I did a quick search of singleton in Quercus and didn't see anything so I hope this is not a dupe. | ||||||||
Attached Files | |||||||||
|
Notes | |
(0002889) mardala 03-24-08 16:00 |
self(); works. I just found out. Also this works: $c = __CLASS__, self::$instance = new $c; |
(0003058) ferg 05-12-08 17:19 |
php/0957, php/3957 |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed. 27 unique queries executed. |