Re: AW: [PHP-DEV] Basic Namespace Requirements
| From: | Wez Furlong | Date: | Sun, 04 Dec 2005 19:02:28 +0000 |
| Subject: | Re: AW: [PHP-DEV] Basic Namespace Requirements | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-21039@lists.php.net to get a copy of this message | ||
You're ignoring the case where people use "my\namespace" as a string
to pass into eg: the reflection API, call_user_function etc. etc.
--Wez.
On 12/4/05, Marcus Boerger <helly@php.net> wrote:
> Hello Wez,
>
> Sunday, December 4, 2005, 7:45:14 PM, you wrote:
>
> > On 12/4/05, Marcus Boerger <helly@php.net> wrote:
> >> >> Wrong assumption. The \ won't need to be escaped.
> >> > Err, what about "my\namespace" ?
> >>
> >> That would be the string "my" <newline> "namespace".
>
> > Exactly.
>
> >> As a classname it would be "class namespace in namespace my".
> >> I guess your point is how to use that in ""-$-expressions, right?
> >> $bla = "${foo\bar::constant}";
>
> > Thus it does need to be escaped when used in double-quoted strings.
>
> No, it uses the same parser inside ${...} or $[a-zA-Z_][a-zA-Z_0-9...]+
> as it does for other stuff too. So no no escaping is needed.
>
> Best regards,
> Marcus
>
>