Date: 09/30/01
- Next message: Jeroen van Wolffelaar: "Re: [PHP-DEV] Bug in autoconf report"
- Previous message: Zak Greant: "Re: [PHP-DEV] Bug in autoconf report"
- In reply to: Andi Gutmans: "[PHP-DEV] namespaces ambiguity"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
----- Original Message -----
From: "Andi Gutmans" <andi <email protected>>
To: <php-dev <email protected>>; <engine2 <email protected>>
Sent: Sunday, September 30, 2001 12.31pm
Subject: [Zend Engine 2] namespaces ambiguity
> Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or
> $test?(FOO:BAR):BARBARA?
I guess I'm confused about the ambiguity here. ':' isn't a legal character
in the name of a constant, right? So "BAR:BARBARA" wouldn't legally be the
name of a constant -- only a constant 'BARBARA' in the namespace 'FOO'. So
then "FOO:BAR:BARBARA" would be the constant "BARBARA" in the nested
namespace "FOO:BAR".
Perhaps the ambiguity is because this string is in double-quotes? Then it
could be made unambiguous like this: "{$test}?{FOO:BAR:BARBARA}". This way,
the parser could recognize the namespaced constant as opposed to the string.
(I'm not sure of the details of using constants in strings -- I've always
referred to them outside any quotes with the string concatenation operator.
Like: $test . '?' . BARBARA -- but) It only seems logical to extend the
"unambiguating" curly-braces to constants inside any construct where
variable/constant expansion is necessary.
In ambiguous times, I would like to see PHP give an "ambiguity" error -- or
a parse error. Or perhaps for backwards compatibility, the parser should
assume that inside double-quoted strings/heredocs that ':' has no special
meaning unless inside curly braces where variable expansion takes place.
Anyway, if I'm not seeing the real ambiguity here, let me know.
Dean Hall.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jeroen van Wolffelaar: "Re: [PHP-DEV] Bug in autoconf report"
- Previous message: Zak Greant: "Re: [PHP-DEV] Bug in autoconf report"
- In reply to: Andi Gutmans: "[PHP-DEV] namespaces ambiguity"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] Re: [Zend Engine 2] namespaces ambiguity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

