Giedrius D wrote:
> On 10/23/07, Gregory Beaver <[EMAIL PROTECTED]> wrote:
>   
>> The same confusion that is brought about by allowing keywords as
>> variable names?
>>
>> <?php
>> class Test
>> {
>>     public $class;
>> }
>>
>> $a = new Test;
>> $a->class = 1;
>> ?>
>>
>> Is this next example any more confusing?
>>
>> <?php
>> class Test
>> {
>>     function class(){}
>> }
>>
>> $a = new Test;
>> $a->class();
>> ?>
>>
>> I think you're confused by what is proposed :).
>>     
>
> Yes you are right about the methods but consider something like this:
> <?php
> namespace (Foo::Bar);
> import(new new);
>   
parse error - of all reserved words, only "namespace" and "import" are
allowed as class names in my patch
> // etc.
> ?>
> Looks kinda odd to me although it might have sense in some context.
>
> Anyway my main question was: is there any reason not to use keyword "use"?
The only reason for me is that "use" implies some kind of autoloading,
as I suggested in one of my other mails.  This gets into parsing
semantics, something I'm not interested in doing.  If the folks go with
"use" that is fine, but for me personally not the best solution, which
is why I put hours into making this patch.

However, no matter what I definitely would like to see code written for
PHP 5.2 and earlier that uses "import" or "namespace" as class names or
functions continue to work in PHP 5.3.  "namespace" is used commonly for
XML information (for obvious reasons), and import is a very common idea,
as already stated.

Greg

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to