Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101325 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64372 invoked from network); 11 Dec 2017 15:55:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2017 15:55:50 -0000 X-Host-Fingerprint: 5.67.70.122 0543467a.skybroadband.com Received: from [5.67.70.122] ([5.67.70.122:20511] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/FD-53433-48AAE2A5 for ; Mon, 11 Dec 2017 10:55:49 -0500 Message-ID: <05.FD.53433.48AAE2A5@pb1.pair.com> To: internals@lists.php.net References: Date: Mon, 11 Dec 2017 15:55:48 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 5.67.70.122 Subject: Re: [RFC] Namespace-scoped declares, again From: markyr@gmail.com (Mark Randall) On 11/12/2017 13:43, Nikita Popov wrote: > Namespace-scoped declares are perfectly suited to resolve this problem. We > can introduce a require_explicit_send_by_ref declare directive to make the > call-site annotation required, and libraries/projects can easily opt-in to > it using namespace_declare(). Seems solid to me, I would definitely make use of this feature, as I found adding the declare to each file felt untidy and even a little clumsy. I certainly like the direction that PHP seems to be moving in terms of making the script structure more like a compiled application, rather than a set of independent scripts. If this doesn't pass, long term I think the main alternative would be to have a single statement that was like a quasi-include of declarations in another file, almost like a ".h" declare_import('/my/namespace/nsprefs.php'); -- Mark Randall