Re: [RFC] [PRE-VOTE] Union types
| From: | Rowan Collins | Date: | Fri, 03 Jun 2016 12:18:49 +0000 |
| Subject: | Re: [RFC] [PRE-VOTE] Union types | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93743@lists.php.net to get a copy of this message | ||
On 03/06/2016 12:59, Bob Weinand wrote:
Gah, I keep making that mistake in my examples. I did say I was struggling to get my head around things! ;) I'm still missing an explanation of exactly where you derived the current proposed rules from, though. The RFC just states "these rules are not an invention of this proposal", but goes on to say "applies PHP casting rules in a sane way", which implies some decisions were involved in drawing up these rules. I think you may be right that the rules are as simple as they can be, and I don't want to waste too much of your time, but a basic summary of the reasoning used would be much appreciated. Regards, -- Rowan Collins [IMSoP]function l(string | float $x) { echo gettype($x); } l("1.5a"); // I would expect string, but float would succeed if attemptedExact matches *ALWAYS* match without coercion.