Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32934 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88325 invoked by uid 1010); 23 Oct 2007 18:52:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88310 invoked from network); 23 Oct 2007 18:52:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2007 18:52:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:56205] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/55-03376-8F24E174 for ; Tue, 23 Oct 2007 14:52:41 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 822ACD0F214; Tue, 23 Oct 2007 11:52:37 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-13-199.neb.res.rr.com [76.84.13.199]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 99CA0D0F082; Tue, 23 Oct 2007 11:52:36 -0700 (MST) Message-ID: <471E43DE.9030706@chiaraquartet.net> Date: Tue, 23 Oct 2007 13:56:30 -0500 User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: Giedrius D CC: Stanislav Malyshev , PHP Internals References: <471D1600.2030603@zend.com> <471D2FDC.8010505@chiaraquartet.net> <471D394F.50007@zend.com> <471D6DDC.4050705@chiaraquartet.net> <3d1a63d10710230208i35424b14u3fb454b5b7fd4eca@mail.gmail.com> <471DFF3F.2040609@chiaraquartet.net> <3d1a63d10710231042r6a1c9067t119ad6572fa22273@mail.gmail.com> In-Reply-To: <3d1a63d10710231042r6a1c9067t119ad6572fa22273@mail.gmail.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] Re: import/use last call From: greg@chiaraquartet.net (Gregory Beaver) Giedrius D wrote: > On 10/23/07, Gregory Beaver wrote: > >> The same confusion that is brought about by allowing keywords as >> variable names? >> >> > class Test >> { >> public $class; >> } >> >> $a = new Test; >> $a->class = 1; >> ?> >> >> Is this next example any more confusing? >> >> > 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: > 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