Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_closures.c zend_closures.h zend_object_handlers.c /tests closure_033.phpt closure_034.phpt

[email protected] (Stanislav Malyshev) Sun, 11 Jan 2009 17:33:08 -0800
Newsgroups php.zend-engine.cvs
Organization Zend Technologies
Message-ID <[email protected]>
Hi!

> I'm wondered where this behavior comes from (It was never proposed or
> may be I missed it).

I don't remember any description of it either, maybe I missed it? What 
does it do? From tests I see that it actually uses $this in non-object 
context, which looks rather strange, could you explain what this is about?

> Now, the simple assignment of closure to property and back changes its
> internal $this pointer.

I think we never had objects that change on simple assignment of them to 
one place or the other, should we start now? Especially that we need 
special treatment in the engine for one specific class for that (and it 
also breaks inheritance since it checks only for this class and not for 
child classes). I think such kind of magic leads to overcomplication and 
  usually is a bad idea unless there's a very good reason for it.
-- 
Stanislav Malyshev, Zend Software Architect
[email protected]   http://www.zend.com/
(408)253-8829   MSN: [email protected]