Hi Marco, On Thu, May 25, 2017 at 6:58 PM, Marco Pivetta <ocram...@gmail.com> wrote: > On Thu, May 25, 2017 at 4:30 PM, Andrey Andreev <n...@devilix.net> wrote: >> >> I'm trying, but fail to find a source that says replacing stdClass >> with mixed/any/etc is ok. > > > It is OK for a subtype to handle a wider range of types than its contract, > it is not ok for the subtype to handle a smaller range of types than its > contract. > > A contract says what you "must" be able to do to satisfy it, so the > invariants hold. >
Sorry, but by "source" I didn't mean somebody state it here. :) When I said I don't claim to fully understand LSP, I didn't mean "tell me what it is" - I'm familiar with it. What I don't understand is how do we get from this: > Wikipedia: > > an object of type T may be substituted with any object of a subtype S To this: > A single type may be substituted by any other type Cheers, Andrey. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php