Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83069 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33064 invoked from network); 18 Feb 2015 14:31:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 14:31:53 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wg0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:33630] helo=mail-wg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/34-18888-852A4E45 for ; Wed, 18 Feb 2015 09:31:52 -0500 Received: by mail-wg0-f50.google.com with SMTP id l2so1456665wgh.9 for ; Wed, 18 Feb 2015 06:31:49 -0800 (PST) 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=EP9x6LO5h4f0/rKM1miwzuXQfiYpAluJY60uaVkKH2c=; b=aZEV2lXjyUjtPEgEddcXlOkRBnvD/4HKdpH7jCtaCVYK6Sb3CdVyMlPwalMa0fmfSI JuWUxfSFvzzKc834S8sKE2+sXMcBLvGmaT77ffJVEZ5Jn/ZFQ1UsccePmDW83ZMbUCxN lnqI6sVuG1+HZMXXLZPH4N/DfG7M7Qnvdv9wLKUQtEr9QEL6j7hRfk8vPX2UlPpAji92 5pl7aa69rYidfUyHh+3EziMB1y06LJyjVwjMjVzEvAEh9Z+kAu7KHXtF1CE+B6amAC3N Bj0ki6YVHWWd00XiWA1Wxr9PP8mztDr1AsORiGiXwfGjMgM+ttfazPB3F2I5ak37I1oR Rqgw== X-Received: by 10.180.20.212 with SMTP id p20mr743047wie.68.1424269908795; Wed, 18 Feb 2015 06:31:48 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id hm6sm32906845wjb.32.2015.02.18.06.31.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 06:31:48 -0800 (PST) Message-ID: <54E4A246.9040405@gmail.com> Date: Wed, 18 Feb 2015 14:31:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <54E49135.60907@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Scalar Type Hints v0.4 From: rowan.collins@gmail.com (Rowan Collins) Leigh wrote on 18/02/2015 13:31: > On 18 February 2015 at 13:18, Rowan Collins wrote: >>> This leaves us in a state where some functions will have defined types >>> with their aggressive coersion rules and some will not, and we can't >>> expect users to remember which set of functions have been updated or >>> not. >> That's precisely the case for every existing user-defined function. >> Switching to PHP 7 won't suddenly add type hints to every function in every >> library and every existing bespoke code base, so there is no way to avoid >> that thought process. > Of course, and some people may opt to avoid type hints altogether in > their own code to avoid this, but they can't avoid changes to internal > functions. How do we plan to release these incremental changes? We try > and minimise BC as much as possible so a patch release might not be > possible. Do we restrict it to minor versions, i.e. the yearly release > schedule? Yes, I think that would be sensible. The aim would still be for most internal functions to have type hints by 7.0, since most of them have trivial signatures, particularly if we can agree a suitable set of union types. Internal function "signatures" (which are currently only signatures in the manual, and a bunch of procedural ZPP magic in the source) change between minor versions fairly often, so "function x will now raise errors in strict typing mode for values that would previously have been accepted" seems a reasonable change note for 7.1, 7.2, etc. I can't foresee any reason why we'd urgently want to add a typehint in a patch release. I can, though, see a rush to get every internal function typehinted by using ZPP causing unintended consequences, and us having to rush out fixes in 7.0.1. > >>> I think the rules need to apply to everything or nothing. >> The rules will apply to everything in the same way - if a function is >> typehinted, it behaves like so; if it's not, it behaves the same way it did >> in PHP 5. > That's not really what I meant. So a user doesn't have to keep track > of which internal functions are now typed and which are not, all > functions should be typed at the same time, or none at all. Yes, I'm sorry, I deliberately took the sentence more generally than it was intended in order to make a different point. I find the lack of consistency between internal and user-defined functions really frustrating as a user, so am always on the look out for rules that can apply neatly to them both. Regards, -- Rowan Collins [IMSoP]