Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81107 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35820 invoked from network); 25 Jan 2015 04:19:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2015 04:19:58 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:46507] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/D3-11456-DEE64C45 for ; Sat, 24 Jan 2015 23:19:57 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 01CC8B0007B; Sat, 24 Jan 2015 23:19:54 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MoChYZD9TotZ; Sat, 24 Jan 2015 23:19:53 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 00967B00068; Sat, 24 Jan 2015 23:19:52 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54C46DB4.2090406@gmail.com> Date: Sun, 25 Jan 2015 04:19:49 +0000 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <4430AC4E-3D85-4672-868B-5A1E939FAE85@ajf.me> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <90B1885A-E767-484E-8F38-A791E8A3FE9B@ajf.me> <54C46DB4.2090406@gmail.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) Hey Stas, > On 25 Jan 2015, at 04:14, Stanislav Malyshev = wrote: >=20 > Hi! >=20 >> going to a vote. That said, I do lean towards always strict, given >> you can usually ensure your return type=E2=80=99s correct. >=20 > Wait, so we would have two modes, strict and non-strict, but also in > non-strict mode, return types still will be strict? Yay, consistency! Yes, it would have that inconsistency, so there=E2=80=99s also the other = possibility of being weak for return types in weak mode. Thing is, I haven=E2=80=99t seen (so far) anyone who seems to think = return types should be converted. We don=E2=80=99t do this for internal = functions (to be fair, there=E2=80=99s no need, C is statically-typed). = Them being strict would follow the robustness principle, too: =E2=80=9Cbe = conservative in what you send, be liberal in what you accept=E2=80=9D. On the other hand, it may not be terribly fitting with =E2=80=9CPHP=E2=80=99= s weakly-typed nature=E2=80=9D. It=E2=80=99s hard to say. -- Andrea Faulds http://ajf.me/