Re: Parameter type widening RFC
| From: | Rowan Collins | Date: | Sun, 28 May 2017 15:49:34 +0000 |
| Subject: | Re: Parameter type widening RFC | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99215@lists.php.net to get a copy of this message | ||
On 28/05/2017 14:25, Rasmus Schultz wrote:
With an explicit mixed type-hint, you can still achieve what you wantYou are making a valid point in general, but you clearly haven't read or understood the explanations you've been given why an explicit mixed type-hint will NOT achieve what the authors of this RFC wanted. If an existing class implements a library's interface, or extends a library's base class, with no type hint, then the library currently has to break both backward and forward compatibility to add type hints: the user of the library will *have to* add the type hints to their implementation, and once they do so, they will *have to* require that minimum version of the library. If the user of the library has to add "mixed" to all their method signatures to use the now-type-hinted library, the library still has to declare a breaking change, so that feature would not help this use case, even if it would be better in others. Regards, -- Rowan Collins [IMSoP]