Re: alpha2 scheduled

From: Date: Thu, 28 Aug 2008 00:57:37 +0000
Subject: Re: alpha2 scheduled
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-40115@lists.php.net to get a copy of this message
Hello Marcus, Em Qua, 2008-08-27 às 23:47 +0200, Marcus Boerger escreveu: > Hello Hannes, > > Wednesday, August 27, 2008, 8:32:41 PM, you wrote: > > > On Tue, Aug 26, 2008 at 18:27, Lukas Kahwe Smith <mls@pooteeweet.org> wrote: > >> - Curly braces support for namespaces (Marcus, not ready for alpha2) > > > Why not? I thought I saw a patch for this on the list recently (which > > allowed both the current namespace foo; and namespace foo {} > > syntaxes).. > > It was an incomplete patch that simply allowed the syntax but did not > prevent code between two namespaces. That my old patch prevent the code between namespaces, but it only allow the syntax using { }. Then, I've updated it, now it allows both ({}, ;) Well, maybe it can be useful... Results using the patch: <?php namespace a { namespace b { } } Fatal error: Nested namespace is not allowed in %s on line %d --------------------- <?php namespace a { namespace b; } Fatal error: Nested namespace is not allowed in %s on line %d --------------------- <?php namespace a; namespace b {} namespace c; print 1; // OK, no error! --------------------- <?php namespace a; namespace b {} print 1; Fatal error: This script contains namespaces, all other code must be contained within namespace declarations in %s on line %d --------------------- <?php namespace a; print 1; namespace b {} // OK, no error! --------------------- <?php print 1; namespace a; Fatal error: Namespace declaration statement has to be the very first statement in the script in %s on line %d http://felipe.ath.cx/diff/namespace-braces-5_3.diff -- Regards, Felipe Pena.

« previous php.internals (#40115) next »