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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php