Re: Parameter type widening RFC
| From: | Marco Pivetta | Date: | Thu, 25 May 2017 15:58:59 +0000 |
| Subject: | Re: Parameter type widening RFC | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99179@lists.php.net to get a copy of this message | ||
On Thu, May 25, 2017 at 4:30 PM, Andrey Andreev <narf@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.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/