Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78253 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12914 invoked from network); 22 Oct 2014 22:01:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2014 22:01:45 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.174 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.220.174 mail-vc0-f174.google.com Received: from [209.85.220.174] ([209.85.220.174:60022] helo=mail-vc0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/88-63701-84928445 for ; Wed, 22 Oct 2014 18:01:44 -0400 Received: by mail-vc0-f174.google.com with SMTP id hq12so2553061vcb.5 for ; Wed, 22 Oct 2014 15:01:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=RvSmCdcK5wpII7y4iYq+5kcIXMKbogvBmVweSVvS8ck=; b=QdTW+4NZrrG54i7AVA1lyTnZX15weTgklbfwW7xgqzj/qqJewYCZJirp+0+qKPHOJA 7xmobp28EoixOuwItqkndhGji/QTnWsVaqhwKel4jf2FW0MWxpznxRRPsp5Qzb4PSjkm X1t9qXtFgBR5Ap98wsE63EUGRT9Ul83rTRjB4O1ok9PF5/ywhqSsNogWIopvdBd/WB8n t3JaHhn1O4f4+qYQwtpGyaqjTa9D1qMOZYrLTY6tbHVWxgxELcoLx/S76zUq016BF8E2 hah7GqzaZyhjKgpRPZTduIOIfM8YUWV44Mtt5L6BhT76eGV0SfreMXTJX1w31M25jhGz Q8Pw== X-Gm-Message-State: ALoCoQm850GzzloYmNsgzj1xiF7OaXfjyBboSEKakW31FoNsNnQ8ujWGMhp/4JyrlakDyctsawALheo0GmCh71tAozCy+/U2mZjRWXpIANIwhwI3Vts9C/kwjkSu0cWeIUkqPhboMsOYxsdJnAhKqMaIoeR211hX0g== X-Received: by 10.220.169.141 with SMTP id z13mr674549vcy.20.1414015301821; Wed, 22 Oct 2014 15:01:41 -0700 (PDT) References: <66B7B28C-2651-4A71-AC2A-55D4C7BB3DDC@ajf.me> <866A39C7-6F11-408D-8BCA-594BA22E8569@ajf.me> <5447682B.2080100@sugarcrm.com> <019325A5-4F82-4179-B4D7-29E5649B2616@ajf.me> In-Reply-To: <019325A5-4F82-4179-B4D7-29E5649B2616@ajf.me> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJkwG276Wk0Upx97kt7WiAQcULrfAGSwBqnAi5QI8QCGl+NrgJ4wNJWAjMdez6avspE8A== Date: Thu, 23 Oct 2014 01:01:41 +0300 Message-ID: <77c09d71b5ee91245640e414c320518d@mail.gmail.com> To: Andrea Faulds , Stas Malyshev Cc: Dmitry Stogov , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: RE: [PHP-DEV] [RFC] Safe Casting Functions From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Andrea Faulds [mailto:ajf@ajf.me] > Sent: Wednesday, October 22, 2014 9:20 PM > To: Stas Malyshev; Zeev Suraski > Cc: Dmitry Stogov; PHP Internals > Subject: Re: [PHP-DEV] [RFC] Safe Casting Functions > > > > On 22 Oct 2014, at 09:17, Stas Malyshev > wrote: > > > > If those are opcodes, those rules will require 2/3 majority for > > acceptance, since those will be the engine rules for type conversion, > > not just a set of functions. And, of course, the rules not matching > > the other engine rules for type conversion, sorry for sounding like > > broken record. > > No, it wouldn=E2=80=99t require a 2/3 majority. Andrea, It absolutely would, regardless of the optimization. Whether or not it's implemented as functions or opcodes indeed matters very little. What matters is what it will be perceived as by average developer. And a set of functions named to_int() will absolutely be perceived as a part of the core language, in the same way is_int() is. The RFC itself makes an assertion that fundamentally contradicts the notion that these are 'just functions'. The RFC reads 'They also prevent any suggestion of strict type hinting for scalar types, because if that were to be added, users would simply use dangerous explicit casts to get around errors and the result would be code that is buggier than it would have been without type hinting at all.' While it doesn't explicitly say so, it's clear that one of the goals of the RFC is make it easier for a 'strict typing' RFC to be accepted in the future. This is a clear indication this constitutes a fundamental change to the core language. Changing the function names so that will diffuse confusion on whether or no= t they represent the official typing rules of PHP - can change this into a 50%+1 RFC. Otherwise, this is a very, very clear 2/3 RFC. Zeev