Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58609 invoked from network); 11 Mar 2017 13:34:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2017 13:34:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wm0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:33477] helo=mail-wm0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/61-38004-2DCF3C85 for ; Sat, 11 Mar 2017 08:34:11 -0500 Received: by mail-wm0-f51.google.com with SMTP id v203so2746752wmg.0 for ; Sat, 11 Mar 2017 05:34:10 -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=49SPsji8JSlr0ciQnZSEtrbAPsfXcRiStGIvqpDCZsI=; b=ulbgGHiV6+5PwWTs12vcgziM7//qHYxyUJU4i9tKTZNVDPf5vkNniWqsrauJPMENmz 2NaepYAHwjQDDHd5v1gA7o+KAUc05zRWvEpi7GoDkFxTV5nV5tFC3/zL/l6azfcbvINZ eEvMJx1BL8TBxNISNEIHrKXLNKmzsg38xTXYJxTQ+zZmYYyiEzAQ7nSYIjW2xOtCrtLl t5YJ5IVuyNxF9Bh4DG2x44BJOidEeitvtR1D7I3JdXbpnLPKff6p6owy95zotC4NuMMT Dq/1B9s9nLg3n9TqeHBSRRkbHuEBb956lWf+rpt3JTvd0a4jkROngXenvWUbrswW9g9m rKeA== 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=49SPsji8JSlr0ciQnZSEtrbAPsfXcRiStGIvqpDCZsI=; b=jkHH57KjeMy668ZjyUqHmyZ51s9lPWMfXF9r3GAcqQvGloNmDB9lPKnHiJqy6x2GBm uKnWy+lh4MVIgmf+e1K9aBrkibtNOGyQ80smIMPoKStXsyzCXRk8/dJQRxe8+dJtGyyC hym7vmWaFZqexPhXub58tXSv5aea8MhXqt2k9PZOtBpocuAUnEMIZ3sYfiSeseTLrzXO IpKvc3dMP6dgT2HXKT/e+mt+pbrj3xBtofPf7vqVZCbw0k+IUs0dKFtt4Vm6i/bWwZ84 5mCTiRD2/SC7Q0fxVsgKHS9GaR1b8qhAeaNpeP/ImWdA7kgilDcoCPlgbuLPcNuvAfP0 Tfig== X-Gm-Message-State: AFeK/H0Yc2Uy2uA8gNBJIk/cazYYvBWeiFL+xvxttHrv4G7//p2FCoSSJKOQSt11MYTbhQ== X-Received: by 10.28.14.69 with SMTP id 66mr3030496wmo.27.1489239247216; Sat, 11 Mar 2017 05:34:07 -0800 (PST) Received: from [10.93.248.190] (94.197.120.166.threembb.co.uk. [94.197.120.166]) by smtp.gmail.com with ESMTPSA id b199sm3681825wmb.13.2017.03.11.05.34.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Mar 2017 05:34:06 -0800 (PST) Date: Sat, 11 Mar 2017 13:34:03 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <24efb0e7-b0e3-68ed-5f42-2d5481f8f291@gmail.com> <44add374-6c4b-399a-c542-8d7f100dfaa3@fleshgrinder.com> <2AB030D8-9677-4E0E-8215-07D77910E51B@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Andrey Andreev ,"internals@lists.php.net" Message-ID: <6BDFA788-B52E-42BE-8794-50959D3A81BE@gmail.com> Subject: Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString() From: rowan.collins@gmail.com (Rowan Collins) On 11 March 2017 13:23:16 GMT+00:00, Andrey Andreev wr= ote: >Ironically enough, the following code executes silently: > > $array =3D ['a', 'b', 'c']; > sort($array, '2234234324'); > >If you don't see the problem with that, I guess it does make "no sense >at all" from your POV=2E Just agree to disagree=2E I see a problem with that, but I see exactly the same problem with this: $array =3D ['a', 'b', 'c']; sort($array, 2234234324); The fact is, "int" is far too loose a type constraint to meaningfully vali= date that parameter=2E The solution to that is not to be more strict in rej= ecting strings, but to create richer types of constraint: enums, unions, do= mains, etc=2E Regards, --=20 Rowan Collins [IMSoP]