Posted by comp.lang.php on 01/08/07 14:17
Hendri Kurniawan wrote:
> >
> >
> > Singleton... I like... :)
> >
> > <?php
> > function & generateSelf() {
> > static $self = null;
> > if(is_null($self)) $self = new EditResultGenerator();
> > return $self;
> > }
> > ?>
> >
> >
> > Hendri Kurniawan
>
>
> Sorry (forgot static keyword in front of function
Actually, I can't use the "static keyword" in front of the function.
Requirements are that it must be compatible all the way back to PHP
4.1.2, so that's out, sorry.
I'll give the rest a try, of course.
>
> <?php
> static function & generateSelf() {
> static $self = null;
> if(is_null($self)) $self = new EditResultGenerator();
> return $self;
> }
> ?>
>
> Hendri Kurniawan
[Back to original message]
|