by-ref return & inheritance
| From: | Stanislav Malyshev | Date: | Fri, 08 Aug 2008 20:32:53 +0000 |
| Subject: | by-ref return & inheritance | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-39773@lists.php.net to get a copy of this message | ||
Hi!
Right now, strict inheritance rules do not allow to override
public function __get($name)
with
public function & __get($name)
I think we may want to allow this (but not the reverse - overriding by-ref return with by-val should not be allowed). Since by-ref return still can be used in by-val context, it should not break the LSP. And it can be useful in some situations - __get having specific by-ref semantics is one of them.
What do you think?
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com