Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93743 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78311 invoked from network); 3 Jun 2016 12:21:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2016 12:21:18 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wm0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:35442] helo=mail-wm0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/72-56709-D3671575 for ; Fri, 03 Jun 2016 08:21:17 -0400 Received: by mail-wm0-f48.google.com with SMTP id a136so273618064wme.0 for ; Fri, 03 Jun 2016 05:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=t7EvzCBXpb4dur4M96/NyL+sU4LeP6bcfCv0EB79rtY=; b=OJx3KNfF2PsEJQqqWL/F3uwDMBSzbjH6RCuIrTx8WFStKzE76v5NpMD3q+VI8UsViQ n8XJd7rxijeiLfxGmV2LVBE+CN+Zv7Ce4wLfaCYNxlsliuOH4sx7u8cBjZt9mJ9jjc05 tv7E+7XjPbC6GRrAf5KYSh3tw53ptWOXwzuc14rtjXLZXZwOSyPXoBeUxatzkPp6qRxr ynrrFMTIqo51HO0xFqNF56VGlXRZJTcFbP5GLny/q9p9YosuVk4I85amYM+Ll1XTWDlP CAuiUc20+3DiQkVNu+mYH6DwKwh5keBdVU9BIA5s/UhHHrYLWQfosRMfi+WN8Ha5Tuwt uAYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=t7EvzCBXpb4dur4M96/NyL+sU4LeP6bcfCv0EB79rtY=; b=m9VjeZr8ISYD1Z6yLZIHXWYYt19kZAFf4qpX5LyLJB+U18KMR3xLzvQbFT31TCws+s W7zPC8iMLO7H564ySML+zsMVu8hpgnhgxg+MzWoL0Qb5LAJ3Veo/yfVMbM8wl7buTeyj cQE32pn7WbJ4v3HThy75qiIfRsXUytppjxFYDa/g/jCzy64a8ZLDRGRpyxNepuEal5Kb UgwB7X1S986+x/ZtCM+PGcw570LSUCVm4ZPnEh6D3+5twfg1UcwA03mEPXtwjUQffJrJ /w0soo08WAUcfG7dhPNfBa7Yy6cFEjoR1nLdVQi4g1snZqnNTTzoB6f3dtQYIIm7jFlP uV7g== X-Gm-Message-State: ALyK8tJ7lGf8EAXW9skR+LNKri80rEQbrmMdDeIZHWdatkfGzfH7EM0kHt3q51ptRPlNfA== X-Received: by 10.28.150.80 with SMTP id y77mr33579843wmd.62.1464956474262; Fri, 03 Jun 2016 05:21:14 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id m3sm5484492wjc.27.2016.06.03.05.21.13 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2016 05:21:13 -0700 (PDT) References: <0A.C5.62101.1C860575@pb1.pair.com> <68b821ac-d71f-4be5-8dca-ae94db332630@gmail.com> <20160603101659.D466A1A81FC5@dd1730.kasserver.com> <6d448fd8-8fda-d795-accb-6b96cd128ccd@gmail.com> To: internals@lists.php.net Message-ID: <652fdc5a-a164-2054-ed61-305a2b72330a@gmail.com> Date: Fri, 3 Jun 2016 13:18:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] [PRE-VOTE] Union types From: rowan.collins@gmail.com (Rowan Collins) On 03/06/2016 12:59, Bob Weinand wrote: >> function l(string | float $x) { echo gettype($x); } >> l("1.5a"); // I would expect string, but float would succeed if attempted > > Exact matches *ALWAYS* match without coercion. 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]