Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8524 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96782 invoked by uid 1010); 15 Mar 2004 15:41:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96719 invoked from network); 15 Mar 2004 15:41:39 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 15 Mar 2004 15:41:39 -0000 Received: (qmail 14923 invoked from network); 15 Mar 2004 15:41:34 -0000 Received: from guardian.zend.office (HELO AndiNotebook.zend.com) (10.1.1.4) by mail.zend.com with SMTP; 15 Mar 2004 15:41:34 -0000 Message-ID: <5.1.0.14.2.20040315174015.0a198dd0@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 15 Mar 2004 17:41:17 +0200 To: Hans Lellelid Cc: internals@lists.php.net In-Reply-To: <4055C6B1.3050101@appliedsec.com> References: <5.1.0.14.2.20040315080605.01732e80@127.0.0.1> <5.1.0.14.2.20040315080605.01732e80@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: class constants in RC1 From: andi@zend.com (Andi Gutmans) At 10:07 AM 3/15/2004 -0500, Hans Lellelid wrote: >I notice that in the new RC1, the following reference to class constants >is no longer possible: > >class MyClass { > const MY_CONST = 1; > function __construct() { > echo MY_CONST; > } >} > >You must now use self::MY_CONST to reference the class constant. While I >can see that the pre-RC1 behavior would not provide a way to access global >constant if class had const of same name ... I figured I'd ask anyway >whether this change is intended or a side-effect of some other fix. I >fall into the category of people who were really enjoying not having to >specify self:: before (so now I have a lot of code to fix, apparently). Hey, I fixed it intentionally. That piece of code was left over from the days of our broken namespaces implementation where we would do two lookups. Methods were fixed a long time ago but we forgot to remove the old code from constants. Andi