RE: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out there)
| From: | Bob Silva | Date: | Sat, 26 Nov 2005 02:36:42 +0000 |
| Subject: | RE: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out there) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20480@lists.php.net to get a copy of this message | ||
For what its worth (not much), I'd rather give up namespace constants and
use : rather than enforce whitespace which is just BAD from a language
perspective. Makes it feel like programming in bash. The concept behind
namespaces (in PHP at least) is rooted in OOP, so requiring a class just to
have constants in your namespace isn't too much to ask for. The parser
should always be able to handle <namespace>:<class>::<whatever> and not
conflict with other syntax.
If we are truly stuck with \ so be it, but I think alternatives with some
level of compromise should be considered before \ is settled upon. It's just
plain awkward IMO.
Bob Silva
> -----Original Message-----
> From: Christian Schneider [mailto:cschneid@cschneid.com]
> Sent: Friday, November 25, 2005 4:42 PM
> To: Marcus Boerger
> Cc: PHP internals
> Subject: Re: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out
> there)
>
> Marcus Boerger wrote:
> > here again namespaces would be perfect. Given a lib that doesn't
> prefix
> > you'd simply do:
> > namespace LibNameHere { reqire "some_lib_include"; }
> > and be done...wohooo :-)
>
> Only if newly introduced PHP core classes use a namespace too. You'll
> have to use PHP\Date (or the like) if you want to avoid conflicts in
> existing code. Plus maybe something like "import PHP\Date as Date" or
> something along these lines if you want to avoid PHP\ in newly written
> code where you know that there is no Date class yet.
>
> PS: I'd rather have : for namespaces with the whitespace restriction for
> ? a:x : b:y than the confusing (escaping characters outside of a
> string?) backslash.
>
> - Chris
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php