Re: Regarding constructions like func()[0]
| From: | Stanislav Malyshev | Date: | Tue, 10 Nov 2009 17:58:58 +0000 |
| Subject: | Re: Regarding constructions like func()[0] | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45998@lists.php.net to get a copy of this message | ||
Hi!
Whilst you are all thinking about this, how about ... $value = (function(){return $x;})();I tried implementing that but it's not straightforward because you need to keep the result of first call while everything inside () is calculated (which can be any number of expressions including function calls etc.) which wouldn't work with naive implementation, since by default it doesn't have correct refcount to be preserved and if you change it you need to add cleanup somewhere. BTW I'm not sure the ()[] works there too - did you try to put some complex expressions with multiple fcalls inside []? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com