Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81605 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66151 invoked from network); 2 Feb 2015 16:45:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 16:45:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=leverton@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leverton@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.41 as permitted sender) X-PHP-List-Original-Sender: leverton@gmail.com X-Host-Fingerprint: 209.85.220.41 mail-pa0-f41.google.com Received: from [209.85.220.41] ([209.85.220.41:33465] helo=mail-pa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/86-34915-3B9AFC45 for ; Mon, 02 Feb 2015 11:45:40 -0500 Received: by mail-pa0-f41.google.com with SMTP id kq14so84447778pab.0 for ; Mon, 02 Feb 2015 08:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=gUsy8ikG4Eu7PAKB2kDREU6KRRyorq/h1cLW64UPCEE=; b=QI+4fjNCwrYQiEvTxWyH9nCw6tq16A8JY71iHuIfJE3J/DIXcjH6dIYyH9ys9kIAFq Z0uEjx7ywLhnSKaaU82EPW8g2lBWuG8nKZLpRh9mpDwX4GHrzf7LXHcQBdhYG/K50hJH eeAW/7iW+YEUwJpUM/2PFYZNCb/GVEQUHSHyE5JaBaAbFDTbdWI26CRWk8+GVgKXDb+Q KRHskaLrbES92+5aVs4Lz/VMyWomLv7VhO2k/AKgeCCAb4/9AT+WZ7xJFYPH8kXQ/SXq alVM0aJWMZkUfJPuR85nyRQSjR2lK1jQRtNuMKMuZ/uEY7j7vYoP/FiSB9iCx+i9y2IZ 8qBw== MIME-Version: 1.0 X-Received: by 10.68.129.6 with SMTP id ns6mr30064036pbb.137.1422895536332; Mon, 02 Feb 2015 08:45:36 -0800 (PST) Received: by 10.70.65.130 with HTTP; Mon, 2 Feb 2015 08:45:36 -0800 (PST) In-Reply-To: References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> Date: Mon, 2 Feb 2015 10:45:36 -0600 Message-ID: To: Andrea Faulds Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: leverton@gmail.com (Matthew Leverton) On Sun, Feb 1, 2015 at 5:49 PM, Andrea Faulds wrote: > Good evening, > > The RFC has been updated to cover return types, since Levi=E2=80=99s Retu= rn Types RFC has passed. The patch is a work in progress: it works, but lac= ks tests for return types. > > Version 0.3 of the RFC can be found here: https://wiki.php.net/rfc/scalar= _type_hints > After thinking and talking this over, I do think your RFC is the only option that makes sense *if* you want to support both weak and strict. However, I think the usage of declare() makes it dead in the water. Fair or not, I have a hard time looking past that. I'm opposed to other compromises because I think it will be a big mess from the caller's perspective. (Some functions would be strict, some would not ... eventually forcing everybody to just use strict types.) And, as I've stated previously, I prefer strict types. Does the implementation of strict-only work for testing right now? (If so, what branch is it on, etc?) It's easy for everybody to theorize about how this would work, but why not actually take the time to "strictify" some part of a commonly used library and see how it actually works in practice? But a library with type-hints + a script to prepend "use strict" to every PHP file would make testing impact on real-world usage easy for anybody. -- Matthew Leverton