Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69015 invoked from network); 27 Dec 2017 09:51:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Dec 2017 09:51:55 -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.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:37377] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/A0-47595-A3D634A5 for ; Wed, 27 Dec 2017 04:51:55 -0500 Received: by mail-wm0-f41.google.com with SMTP id f140so38359096wmd.2 for ; Wed, 27 Dec 2017 01:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=32/xgxIhvCdd3Swn6z7oR5Ze38neu4+Zw6uGPIGg0wE=; b=ZoQPm3rqw7nAkqBXEM7F3EWqhSV+CtQjIkf41KTRKbj9OTQgzEzDh/pSsk7ByZKT46 uz1WV2MJ4ZlBoMBNJKu7OfXkBD2zgU3EKUhrkPoRQIqXvTbUoZWp69MGOzfzLmANa4cm oHgnuVAbcDA2uet70RyOnVeuEPw+t/G4NmUlLPIwy+YLNk/Wl3EHJf2g5ML8N6Z4HRlG TcnmC89shjnZBryVT8cSDsG56TwlRDjy8zKlq861U5c00LOSu8AyPjOUdvaRho+gKXb/ jdwstAcW7BU0Rgq3/qvDokZGms8kZgdNOGic6qIlqBD5s6bPL5k/zxd1djbPl7OXujYA j/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=32/xgxIhvCdd3Swn6z7oR5Ze38neu4+Zw6uGPIGg0wE=; b=Y9P14C5MNqUMKLxyrAQxGasMpRonehN0r6m7hL3bG7gMVwMpVJLbvWz+aoJFvnBQDy xDcDYdchi+4bB0vcd8BDQ/bNRrDH++txff944sFBuJaEBjwpSKhITHAOw4HCYqeRGeMH WbbEOws5HHRPLuF+gl5tvUf84poyFQj9Nkh4UjnweoW7N32aAoR6WxTzxMwpf5xa7Lvi ucREfNsBBUkNVcsIZX6933K9Yd870em3Pa7PXtPC4P3YBbsLfAHCHqfuLRZdrzETZ2Ok 9CsV82qcWMtN+o6P/03rhCFLHXOSnnEaI0JUkA3f0Nl+AqNW6ni9+pkDXvoMDpWCT5F9 iOMw== X-Gm-Message-State: AKGB3mJRvRNnZYR+UHp76nEMkTL3ERLzeS4jtz95QTbDUr1RMOlvxHan i5i1cm1+/hwIjcDQgjZMi37BSzCr X-Google-Smtp-Source: ACJfBoshULpxgTaOv+3qnw+NJWfA64B1XD5l7je6NoE+7MvC7uRgHCqPIZECv89ffwZ9fxjiscoE4g== X-Received: by 10.80.146.51 with SMTP id i48mr35971365eda.198.1514368311144; Wed, 27 Dec 2017 01:51:51 -0800 (PST) Received: from [10.145.94.174] (92.40.248.176.threembb.co.uk. [92.40.248.176]) by smtp.gmail.com with ESMTPSA id i2sm27607105edb.31.2017.12.27.01.51.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Dec 2017 01:51:49 -0800 (PST) Date: Wed, 27 Dec 2017 09:50:54 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <72392123-d37b-26df-6886-218f48205f8a@fleshgrinder.com> <6894aa94-0400-7a9a-f00c-47f1f556a4d0@php.net> <2241495.C7RNBcXJNU@vulcan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <58A5ABDF-AA25-46D4-83E7-4DE72E3DFF5E@gmail.com> Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type From: rowan.collins@gmail.com (Rowan Collins) On 26 December 2017 18:35:29 GMT+00:00, "lists@rhsoft=2Enet" wrote: > > >Am 26=2E12=2E2017 um 19:18 schrieb Larry Garfield: >> If I may, I think the argument has always been that >>=20 >> 1) Foo & Bar makes total sense >> 2) int|float makes total sense >> 3) int & string is illogical so wouldn't matter anyway > >not true > >function x(int|string $x) >{ > $x =3D (int)$x; >} I think there's a misunderstanding here=2E Some previous proposals for "un= ion types" also included "intersection types", so that you could assert "pa= rameter must implement both of these interfaces"=2E So 'Foo|Bar $x' would m= ean '$x instanceof Foo || $x instanceof Bar' and 'Foo&Bar $x' would mean '$= x instanceof Foo && $x instanceof Bar'=2E I presume that's what Larry means by "int & string is illogical", because = it would translate to "is_int($x) && is_string($x)", which is false for all= values of $x=2E This is different from "int | string", which, as you say, = might have valid uses=2E Regards, --=20 Rowan Collins [IMSoP]