Re: [RFC] Namespace-scoped declares, again
| From: | Mark Randall | Date: | Mon, 11 Dec 2017 15:55:48 +0000 |
| Subject: | Re: [RFC] Namespace-scoped declares, again | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101325@lists.php.net to get a copy of this message | ||
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