Re: AW: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Rowan Collins
Robert Stoll wrote on 13/11/2014 12:30: -Ursprüngliche Nachricht- >Von: Rowan Collins [mailto:rowan.coll...@gmail.com] >Gesendet: Donnerstag, 13. November 2014 11:57 >An:internals@lists.php.net >Betreff: Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP

AW: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Robert Stoll
[PHP-DEV] forbid use declaration outside of a namespace in > PHP 7 > > On 13 November 2014 11:29, Johannes Schlüter wrote: > > > On Wed, 2014-11-12 at 22:27 +0100, Robert Stoll wrote: > > > > > That's still perfectly fine because in your code the use statement &

AW: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Robert Stoll
> -Ursprüngliche Nachricht- > Von: Rowan Collins [mailto:rowan.coll...@gmail.com] > Gesendet: Donnerstag, 13. November 2014 11:57 > An: internals@lists.php.net > Betreff: Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in > PHP 7 > > Robert Stoll w

Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Chris Wright
On 13 November 2014 11:29, Johannes Schlüter wrote: > On Wed, 2014-11-12 at 22:27 +0100, Robert Stoll wrote: > > > That's still perfectly fine because in your code the use statement is > not outside of a namespace, it is implicitly in the default namespace. > > I am talking about the two followin

Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Johannes Schlüter
On Wed, 2014-11-12 at 22:27 +0100, Robert Stoll wrote: > That's still perfectly fine because in your code the use statement is not > outside of a namespace, it is implicitly in the default namespace. > I am talking about the two following scenarios: > > use \Exception; > namespace test; > > $e

Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-13 Thread Rowan Collins
Robert Stoll wrote on 12/11/2014 21:27: That's still perfectly fine because in your code the use statement is not outside of a namespace, it is implicitly in the default namespace. Surely if that's true of Adam's example, it's true of yours as well? namespace a{ } use some\UseDeclaration\w

AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-12 Thread Robert Stoll
> Sorry, I apparently missed this the first time. Would this mean that this > sort of script (where we're using use statements > without a > namespace) would no longer work? > > use GuzzleHttp\Client; > > include __DIR__.'/vendor/autoload.php'; > > $client = new Client; > // $client is a Guz

Re: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-12 Thread Adam Harvey
On 11 November 2014 04:11, Robert Stoll wrote: >> 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 } >>

AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-12 Thread Robert Stoll
> -Ursprüngliche Nachricht- > Von: Stas Malyshev [mailto:smalys...@sugarcrm.com] > Gesendet: Mittwoch, 12. November 2014 00:45 > An: Andrea Faulds; Robert Stoll > Cc: Chris Wright; PHP Internals > Betreff: Re: [PHP-DEV] forbid use declaration outside of a namespac

Re: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-11 Thread Stas Malyshev
Hi! > I don’t like the sound of changing the spec before the implementation. I agree - whatever are our considerations and limitations on what we can and can not do in PHP 7, the spec should reflect what is there. Otherwise we end up releasing an implementation that does not match our own spec, t

Re: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-11 Thread Andrea Faulds
> On 11 Nov 2014, at 13:20, Robert Stoll wrote: > >> I would say that the lack of anyone saying "no, don't do this" probably >> means everyone is OK with it. Suggest you work up a >> patch and PR it, then ping the list to highlight it for further discussion. >> > > Sounds reasonable but unfor

AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-11 Thread Robert Stoll
> I would say that the lack of anyone saying "no, don't do this" probably means > everyone is OK with it. Suggest you work up a > patch and PR it, then ping the list to highlight it for further discussion. > Sounds reasonable but unfortunately I do not have time at the moment to work up a patch

Re: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-11 Thread Chris Wright
On 11 November 2014 12:11, Robert Stoll wrote: > > -Ursprüngliche Nachricht- > > Von: Robert Stoll [mailto:p...@tutteli.ch] > > Gesendet: Mittwoch, 29. Oktober 2014 20:55 > > An: 'PHP Internals' > > Betreff: [PHP-DEV] forbid use declaration outs

AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-11-11 Thread Robert Stoll
> -Ursprüngliche Nachricht- > Von: Robert Stoll [mailto:p...@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 ve

[PHP-DEV] forbid use declaration outside of a namespace in PHP 7

2014-10-29 Thread Robert Stoll
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 fo