On 11.12.2017 at 14:43, Nikita Popov wrote:

> Some time ago I introduced the following proposal for namespace-scoped
> declares:
> 
>     https://wiki.php.net/rfc/namespace_scoped_declares
> 
> The idea is to allow specifying declare directives for a whole library or
> project using:
> 
>     namespace_declare('Vendor\Lib', ['strict_types' => 1]);
> 
> I've finally gotten around to implementing this proposal (
> https://github.com/php/php-src/pull/2972) and would like to move forward
> with it.

Generally I'm not keen on letting the language diverge via whatever
mechanism, but that has already happened and there seems to be some
further need, and the namespace scoped declares appear to be preferable
to per-file declares or even ini settings.

What I don't like about the present proposal is that it introduces a
proper function instead of a language construct.  Is there a particular
reason for this design decision?  Couldn't we add the namespace scoped
declares to the namespace declaration directly, e.g.

  namespace Foo declare strict_types=1;

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to