Re: [RFC] [PRE-VOTE] Union types
| From: | Rowan Collins | Date: | Fri, 03 Jun 2016 14:32:58 +0000 |
| Subject: | Re: [RFC] [PRE-VOTE] Union types | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93750@lists.php.net to get a copy of this message | ||
On 03/06/2016 15:24, Thomas Bley wrote:
maybe easier to get a majority from voters if defining union types only in strict mode for 7.1?No go, I'm afraid. Strict types are opt-in at the point of calling the function, but union types are a feature of the declaration. If I write "function foo(int | string $a) {}", it is not up to me whether it's executed in strict mode or not. We'd have to throw an error of "function %s cannot be called without strict types enabled", and that goes against the entire premise of strict types as implemented. Regards, -- Rowan Collins [IMSoP]