Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77203 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74782 invoked from network); 14 Sep 2014 22:39:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 22:39:21 -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.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.180 mail-we0-f180.google.com Received: from [74.125.82.180] ([74.125.82.180:62739] helo=mail-we0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/51-64534-91916145 for ; Sun, 14 Sep 2014 18:39:21 -0400 Received: by mail-we0-f180.google.com with SMTP id t60so3143910wes.11 for ; Sun, 14 Sep 2014 15:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=6TgExr3xOEnFLNPPlfd1bk3sRSyFY/2TB5AkUewdkJo=; b=bZ1LbyaikovlDlFo632RnOBrXJxwWtLpUooPg6ecrUO2dpzZ6ykkQtgEmG0VLzr5x2 a3CKHbIR2TjjLDQXa6kqs4KgLDVZV3UWYCfW8610DgU3QV2sfBQulgl/Q8RkMEzhkdZN aFmft5iocxay9c5wGt89CfEfLUVpIpzA13dbXXYehxxUMq3MFUhO2EqmGaiBEs4ozhH4 hjX2UjxSuC0VcmDisyQbNEP3i4/oN7DMqsJ4/x8ZMZpOZ8Sd67xLBEszEGqqpmgEgBnb HhqctpQE02HRqL0rpMSHNMTr3QdFW51HucNi8Bqe5HOc/8+yjR4yepq0fJ4fzyocXVZs izPw== X-Received: by 10.180.207.100 with SMTP id lv4mr19055947wic.53.1410734358162; Sun, 14 Sep 2014 15:39:18 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id n3sm9647846wiy.10.2014.09.14.15.39.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Sep 2014 15:39:17 -0700 (PDT) Message-ID: <541618FD.3050204@gmail.com> Date: Sun, 14 Sep 2014 23:38:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: PHP internals References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> <54153692.7050500@sugarcrm.com> <9CE963B0-E624-4267-BC2A-0F8D1F985DAE@ajf.me> <6f2236e18c61d30b247e1c6bb2de10f1@mail.gmail.com> <8556C1E7-EDF3-47E2-9DA0-C9AB63DE56E6@ajf.me> <6E402FE8-119A-4BBB-B652-97A0DBEC8BC9@ajf.me> <5415DC76.7070105@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: rowan.collins@gmail.com (Rowan Collins) On 14/09/2014 20:01, Pierre Joye wrote: > One side wants to be consistent with inconsistencies (and tbh quite > confusing) while the other side wants to allow userland implemented > APIs to actually be consistent. I'm not sure that's quite fair. The only thing that would be consistent with existing userland functionality is strict typing, fatal error on incorrect type (since that's what class "hints" do; they're more like assertions than anything else); I'm pretty sure nobody is arguing for that. There's also definitely more than two "sides" here - there are lots of people, with lots of different opinions. I'm guessing what *you* want is for it to be consistent with existing userland casts? i.e. function foo(int $bar) { /* ... */ } is just syntactic sugar for function foo($bar) { $bar = (int)$bar; /* ... */ } Perhaps it would be better to discuss how *useful* that would be as a feature, rather than just how consistent it is or isn't with other parts of the language. -- Rowan Collins [IMSoP]