[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binarycloud-dev
Subject:    [binarycloud-dev] Re: Bug #20175 [Opn->Fbk]: Static vars can't store ref to new
From:       Alex Black <enigma () turingstudio ! com>
Date:       2002-10-30 20:00:15
[Download RAW message or body]

> Can you see if Zend Engine 2 solves this?

Heh,

I'm certain it does, but I'll ask andi on the list to check for us.
It would be reeeeeeally nice yo have for us in 4.2 though :)

Thanks for the quick response.

_a



> ATTENTION! Do NOT reply to this email!
> To reply, use the web interface found at
> http://bugs.php.net/?id=20175&edit=2
> 
> 
> ID:               20175
> Updated by:       derick@php.net
> Reported By:      enigma@turingstudio.com
> -Status:           Open
> +Status:           Feedback
> Bug Type:         Scripting Engine problem
> Operating System: All
> PHP Version:      4.2.1
> New Comment:
> 
> Can you see if Zend Engine 2 solves this?
> 
> Derick
> 
> 
> Previous Comments:
> ------------------------------------------------------------------------
> 
> [2002-10-30 13:34:48] enigma@turingstudio.com
> 
> ola,
> 
> we've recently put in a set of methods in the binarycloud
> core classes so they can enforce their singleton status.
> 
> An example:
> 
>   // {{{ method GetInstance()
> 
>   /**
>    * This method enforces this class's singleton
>    * status. It check s astatic var for an instance,
>    * if that instance exists a reference to it
>    * is returned. If it does not exist it is created
>    * and a reference is returned.
> * @author hans lellelid, hans@velum.net
>    * @access public
>    */
>   function &GetInstance() {
>    static $instance;
> if(!isset($instance)) {
> $instance = new Request();
> }        
>     return $instance;
>   }
> 
>   // }}}
> 
> note the line:
> 
> $instance = new Request();
> 
> that means the instance is always overwritten.
> 
> we have to do that because:
> 
> $instance =& new Request();
> 
> results in a null $instance.
> 
> We believe this is a bug, but it's on the edge of possible
> expected behavior.
> 
> thanks,
> 
> _alex
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@binarycloud.tigris.org
For additional commands, e-mail: dev-help@binarycloud.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic