Hi!

What makes you think there won't be a problem with the reverse. The caller
does not expect a reference but the calle returns one? In OOP the return

Well, I don't know any case where $a = foo() would work in a substantially different way for the user if foo() returns by-ref and not by-val. If you are aware of any such case - please tell, that's exactly why I ask.

value of the derived class' method must be an instance of the class defined
by the base class' method or a subclasse of that. And so far we tream them
different, rather than a reference is a subclass of a normal value or vice
versa.

Err... I'm afraid I don't understand what you mean here. By-ref return is not a subclass of anything - not only PHP has no type control of return values, by-ref is a zval flag and not a type - so I don't think there are any subclasses here per se. What is relevant that value returned by-ref can be used in by-val context.

The question is very simple - can you (or anybody else) think of any scenario that such override would lead to any problem LSP-wise? Any code that wouldn't work with such override?
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to