Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83046 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83133 invoked from network); 18 Feb 2015 11:27:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 11:27:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.177 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.177 mail-we0-f177.google.com Received: from [74.125.82.177] ([74.125.82.177:46916] helo=mail-we0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/BA-18888-73774E45 for ; Wed, 18 Feb 2015 06:27:51 -0500 Received: by wevm14 with SMTP id m14so467725wev.13 for ; Wed, 18 Feb 2015 03:27:47 -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=cBEES2xrfmY/k1o7zDkgQNed9aqNj/tfi3cKGgjj9eI=; b=VVYiUzLW2+0INo9RM8Fm0BQY61JALGkqJxWcf7+pU+viGbM4NeHpIMnpmYdpWzGE2z ocF4/1ISyXr6uVVfHUFgSOJWshk+LNFndvcg3XbLDMJpV9ZirOlnZAcWTaCRPYVWIKCg 4dEEfayIZA+gHwd9wZdLdnwwryS4hGDTKBNKyEr4SKaJ6vm5xw+vMhSUZZr8pw5rEQ9y mufN6Y9C9KCmSvypZ1JhM70apcd1NGq5+nlOBg6CNp9hrXoNELaentKvOp4vX5OyyQ42 FvBtm5cDsm006A8TIFtkxBjkH/v9TqFIPue0kDptuphu5PYTEALA3au1BUNGx9QjFqcj m/QQ== X-Received: by 10.180.38.76 with SMTP id e12mr3921207wik.76.1424258867209; Wed, 18 Feb 2015 03:27:47 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id ev7sm32142317wjb.47.2015.02.18.03.27.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 03:27:46 -0800 (PST) Message-ID: <54E47725.4060801@gmail.com> Date: Wed, 18 Feb 2015 11:27:33 +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: 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) Nikita Popov wrote on 18/02/2015 00:35: > I don't like the way this is heading with regards to internal functions. > Apart from better inter-compatibility, the primary appeal of Andrea's > proposal was that we have the option to make not only userland function > calls strict, but internal ones as well. With these modifications this is > lost for all practical purposes. I actually rather like this idea - it allows internal functions to gradually introduce scalar type hints just as userland code will gradually introduce them, rather than assuming a new meaning of existing metadata. It gives a chance to look, for each function, what hints make sense, separate from the technical requirements of translating to a strongly typed set of C variables, which is the main role of ZPP. Note that, however natural it may seem to core/extension devs, the workings of ZPP are not at all obvious to users, so the more similarities between internal and user-defined type hints, the better. > Where "practical purposes" refers to my assumption that it is very > unlikely that we'll add arginfo typehints to the entirety of all bundled > functions and the added typehints will not be heavily colored by people > trying to shove in weak typing even when strict mode is enabled. I see it working well if a large batch of uncontroversial functions have type hints mechanically added straight away, and then more complex cases are looked at in detail and discussed via pull requests or similar. What you have identified there is a danger to be watched out for, certainly, but it is not an inevitable outcome, if we come up with a decent set of guidelines of how the feature should be used. Regards, -- Rowan Collins [IMSoP]