Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5327 invoked by uid 1010); 17 Aug 2007 16:43:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5307 invoked from network); 17 Aug 2007 16:43:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2007 16:43:48 -0000 Authentication-Results: pb1.pair.com header.from=david.coallier@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=david.coallier@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: david.coallier@gmail.com X-Host-Fingerprint: 66.249.92.170 ug-out-1314.google.com Received: from [66.249.92.170] ([66.249.92.170:64119] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/98-49531-140D5C64 for ; Fri, 17 Aug 2007 12:43:48 -0400 Received: by ug-out-1314.google.com with SMTP id c2so409812ugf for ; Fri, 17 Aug 2007 09:43:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=tZpPUfu2YS3DX6Fbzto7JIKvJrh0TzbJmn2k1TIC5l4G2xQ8b6/iM9LBoFWVMKMMd5GWoZMhtkLUqJTTlmjZqPEt3WC2sQN2gZgssA8GXquviXslCz3DXHfE+qO9960VL0t0xWx/RVo/lTvpvbovrlzXnsCVgXtoHmur+2JU4io= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=JK+cf1KElyrh32vcmCZBKMF49/AfDA4Yn6Kka+fn8eyUYFB/luVFb56ldzEznekTXxbf9FzDKtzn5Tz+PJMl4tnPnPredb2gZ6sR9T/WzfcoYSQgpvUUgRrbHK2JuSjTUR+FCnEdwPmky0e1m5OuuPbCa0cyBl87OoTqesNWOnA= Received: by 10.142.174.8 with SMTP id w8mr198923wfe.1187369019512; Fri, 17 Aug 2007 09:43:39 -0700 (PDT) Received: by 10.143.33.15 with HTTP; Fri, 17 Aug 2007 09:43:39 -0700 (PDT) Message-ID: Date: Fri, 17 Aug 2007 12:43:39 -0400 Sender: david.coallier@gmail.com To: "Alexey Zakhlestin" Cc: "PHP Internals List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 1ceb3e53a72c8177 Subject: Re: [PHP-DEV] Namespace question From: davidc@php.net ("David Coallier") On 8/17/07, Alexey Zakhlestin wrote: > "const" keyword is currently allowed only inside class-definitions; > generic constants are specified using "define()" > I know that.. Right now you can do. --File: ns.php-- namespace What define ('NAME', 'booo'); class Tester { public function __construct() { echo 'yeah.. no!'; } } --File: testns.php-- require 'ns.php'; echo NAME; // Will echo booo without importing the namespace // And $obj = new Tester; // This as it should do, will return an error. // Change to that: import What as A; $obj = new A::Tester; // This will echo yeah...No as it should. So my question is: Anyone thinking in doing const for namespaces thus calling something like What::NAME; // echo 'booo' ? > On 8/17/07, David Coallier wrote: > > Hey guys, looking at the minutes meeting from the paris conf > > (http://php.net/~derick/meeting-notes.html), I was wondering if " > > Constants in name spaces are allowed unless we find problems with the > > implementation. " were implemented. I tried but putting > > > > namespace MyPackage; > > const NAME = 'inspace'; > > > > > > Then I get a parse error. (Unexpected T_CONST..) > > > > Is that normal ? Looking at the minutes notes I can not really see > > what of this list that has been discussed by the attendees has been > > implemented. > > > > Enlighten me someone please. > > > > And yes these notes were built nearly 2 years ago. > > > > Thanks for your replies. > > > > -- > > David Coallier, > > Founder & Software Architect, > > Agora Production (http://agoraproduction.com) > > 51.42.06.70.18 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Alexey Zakhlestin > http://blog.milkfarmsoft.com/ > -- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18