Hi!

With the substantial difference, that __get()/__set() does not work
properly with inheritance, as the language can't verify the LSP.

Language never could verify the LSP. The developer should do it - the language has no idea of what pre/postconditions in your code are. Language can provide a tiny bit of LSP support - namely, method signatures, etc. - but that's it.

This means, Child behaves more strict than Mother and breaks the
principle.

Well, don't write such code. :)

With advanced properties, the interpreter could at least verify that
getting/setting properties is not stricter in subclasses.

How? For that you'd need the interpreter to actually understand what the code does. While I'd like to have such thing one day (provided it does not rebel and decide to kill all humans, of course ;) PHP interpreter is definitely not it.
--
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