Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83462 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72866 invoked from network); 22 Feb 2015 09:30:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2015 09:30:35 -0000 Authentication-Results: pb1.pair.com header.from=shashankkumar.me@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=shashankkumar.me@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: shashankkumar.me@gmail.com X-Host-Fingerprint: 209.85.220.175 mail-vc0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:35319] helo=mail-vc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/C1-08895-9B1A9E45 for ; Sun, 22 Feb 2015 04:30:34 -0500 Received: by mail-vc0-f175.google.com with SMTP id hq12so5602387vcb.6 for ; Sun, 22 Feb 2015 01:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=eSH/rJYSQ7Bd7O8KdldaHMozdF9x02k+Qhfs6Xb2ygE=; b=apdLfnk7fWDcOm1q0o4vCorSNhXuNARCg+vJ+KE0SRPUAtzHBF0DsnThpDUiUJbRkF NANQuvkMjC3U2HdnCN+ZcozXLVeu8Plk/Ek5xUpYvQvrTaj7rp1ioEzxTzpK6ECjCB7/ gEsPfxZIz0jb75UwZiQisGlgLT4s/IhGgbqlh58gydtqP6wmKjPwnWfw2sTuBfstwtmP rYFSoCti+8gWErxim08+d9jU2hZAcl3mcVMtZPS+vlOU2sc3KfFB2yfE3Ut+eU1cGSTd /UJboO3yruryPbcNFmqojt/mvUmH6N/RasxD545Wvk1gbwN2F6/CLR1TAqkkEYoVm5iD /k3Q== X-Received: by 10.52.233.40 with SMTP id tt8mr5662894vdc.77.1424597431598; Sun, 22 Feb 2015 01:30:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.23.52 with HTTP; Sun, 22 Feb 2015 01:30:10 -0800 (PST) In-Reply-To: References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <9aec85c81b49009c6238ff6d8be27cd4@mail.gmail.com> Date: Sun, 22 Feb 2015 01:30:10 -0800 Message-ID: To: =?UTF-8?Q?Pavel_Kou=C5=99il?= Cc: Zeev Suraski , Benjamin Eberlei , PHP internals Content-Type: multipart/alternative; boundary=089e0115ebf4dbc36b050fa9efb3 Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: shashankkumar.me@gmail.com (Shashank Kumar) --089e0115ebf4dbc36b050fa9efb3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Feb 21, 2015 at 2:39 PM, Pavel Kou=C5=99il wro= te: > On Sat, Feb 21, 2015 at 11:25 PM, Zeev Suraski wrote: > > There=E2=80=99s a fundamental difference between the two RFCs that goes= beyond > > whether using a global INI setting and the other per-file setting. The > > fundamental difference is that the endgame of the Dual Mode RFC is havi= ng > > two modes =E2=80=93 and whatever syntax we=E2=80=99ll add, will be with= us forever; and > in > > the Coercive STH RFC =E2=80=93 the endgame is a single mode with no INI= entries, > > and opening the door to changing the rest of PHP to be consistent with > the > > same rule-set as well (implicit casts). The challenge with the Coerci= ve > > STH RFC is figuring out the best transition strategy, but the endgame i= s > > superior IMHO. > > Hello, > > the two modes was something that I didn't like, at all, as a userland > developer. It seems really scary that decision to add 2 modes would > mean that every PHP code could have been written in any of these 2 > ways and it would stick forever with PHP, because removing it again if > it proved to be a bad feature would be IMHO really painful. > > So a single mode is infinitely better than 2 modes. > > Also, personally, I would prefer #1 or #2 version for internal > functions, but definitely without an INI switch. Not being able to > change it on some hostings could make development for the transition > period kinda painful. > > Regards > Pavel Kouril > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > As a userland developer I will chime in and say that I love this rfc better than the dual mode. In my opinion, having dual mode will put unnecessary cognitive burden on me especially when reading other people's code and libraries. While current rfc conversion rules are also different than what exists in PHP but I can get used to them and they are more in line with what should ideally be there (except contentious ones like bool). I will certainly love to see the type coercion rules being unified and slightly tightened up over time and this is a good first step for that. I am not a lang expert but of the languages I have learnt and developed in, I can't think of any that allow dual mode type coercion rules in such an explicit manner as the one proposed by Andrea/Anthony. Thanks Shashank --089e0115ebf4dbc36b050fa9efb3--