Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25929 invoked from network); 22 May 2010 16:25:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 May 2010 16:25:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:53591] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/EA-46027-06508FB4 for ; Sat, 22 May 2010 12:25:05 -0400 Received: by vws15 with SMTP id 15so785787vws.29 for ; Sat, 22 May 2010 09:25:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.107.161 with SMTP id b33mr1989512vcp.253.1274545501930; Sat, 22 May 2010 09:25:01 -0700 (PDT) Received: by 10.220.70.148 with HTTP; Sat, 22 May 2010 09:25:01 -0700 (PDT) In-Reply-To: <7.0.1.0.2.20100522190821.19934438@zend.com> References: <7.0.1.0.2.20100522175819.0a601c68@zend.com> <7.0.1.0.2.20100522190821.19934438@zend.com> Date: Sat, 22 May 2010 12:25:01 -0400 Message-ID: To: Zeev Suraski Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=00c09f8de44ee4878e0487313f1c Subject: Re: [PHP-DEV] Type hinting From: ilia@prohost.org (Ilia Alshanetsky) --00c09f8de44ee4878e0487313f1c Content-Type: text/plain; charset=ISO-8859-1 Zeev, First of all as far as I can tell majority of the changes relate to 2 new type hints you are suggesting to introduce which are numeric and scalar. I don't see any issue with adding those two hints, predominantly for people who don't want to be specific with their type requirements. So, +1 on that portion of the RFC. However, after reviewing your suggested changes to some of the type-specific hints, I think the changes you are suggesting would only introduce confusion. There is a substantial WTF factor for developers, whereby (int)1 === boolean, but (int)12 !== boolean. Or that (int) 12 is either a valid int or a double, but (double)12 is only a double. For one strict type hints are much clearer, if function/method expects type X and anything but type X is provided an error is generated. I think adding the scalar and numeric hints should be a sufficient. On Sat, May 22, 2010 at 12:09 PM, Zeev Suraski wrote: > FYI - I did some fairly major editing on the issues with strict type > hinting and advantages of auto-converting type hinting in the RFC > (beforehand I focused primarily on the conversion table). > > I encourage everyone to take another look at this RFC even if you've read > it before. > > Thanks, > > Zeev > > > At 18:04 22/05/2010, Zeev Suraski wrote: > >> All, >> >> As I mentioned numerous times scalar type hinting is a very controversial >> feature in my mind and requires some substantial discussion before we move >> ahead to implement it. >> As such, I think we should revert the patch that was committed to trunk >> and move to discuss it first instead. >> >> My (& Lukas') thoughts on the subject are detailed at < >> http://wiki.php.net/rfc/typecheckingstrictandweak> >> http://wiki.php.net/rfc/typecheckingstrictandweak >> >> As one of the key people who designed PHP's type system I consider strict >> type checks completely alien to and counterintuitive in PHP and am therefore >> pushing to implement 'weak' typing instead, in a way that's consistent and >> familiar to users. >> >> Zeev >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --00c09f8de44ee4878e0487313f1c--