AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7
| From: | Robert Stoll | Date: | Tue, 11 Nov 2014 12:11:27 +0000 |
| Subject: | AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78869@lists.php.net to get a copy of this message | ||
> -----Ursprüngliche Nachricht-----
> Von: Robert Stoll [mailto:php@tutteli.ch]
> Gesendet: Mittwoch, 29. Oktober 2014 20:55
> An: 'PHP Internals'
> Betreff: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7
>
> Heya,
>
> I always found it very ugly that it is possible to define a use outside of a namespace.
> Consider the following:
>
> namespace{ //default namespace
> }
>
> use foo\Bar;
>
> namespace test{
> new Bar(); //error, test\Bar not found }
>
> After some thoughts it is quite clear that Bar is test\Bar and not foo\Bar inside of the
> namespace test. But consider
the
> following example which is not so obvious:
>
> use foo\Bar;
> namespace test;
> new Bar(); //error, test\Bar not found
>
> The use declaration looks like a normal use declaration at first glance.
> I do not see why we should actually support this "feature" any longer and thus
> suggest to remove it in PHP 7.
Although, it is
> not a bug (the use declaration is simply ignored as far as I can tell) I suppose it confuses
> the user.
> Nevertheless, even if we declare it as a "feature" I think it should at least not be
> a "feature" of the specification
of PHP 7.
>
> Thoughts?
>
> Cheers,
> Robert
>
>
> ps: I first started the discussion @standards, just if you should wonder why it pops up here
> now as well:
> http://news.php.net/php.standards/528
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:
> http://www.php.net/unsub.php
No one else who thinks this "feature" should be removed in PHP 7 ?