Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29453 invoked by uid 1010); 5 May 2004 22:02:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29396 invoked from network); 5 May 2004 22:01:59 -0000 Received: from unknown (HELO mail.keliglia.com) (81.57.253.132) by pb1.pair.com with SMTP; 5 May 2004 22:01:59 -0000 Received: (qmail 11549 invoked from network); 5 May 2004 22:01:56 -0000 Received: from massena-2-81-57-128-152.fbx.proxad.net (HELO keliglia.com) (81.57.128.152) by voltaire-4-81-57-253-132.fbx.proxad.net with SMTP; 5 May 2004 22:01:56 -0000 Message-ID: <40996447.9070801@keliglia.com> Date: Thu, 06 May 2004 00:01:43 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jason Garber CC: internals@lists.php.net References: <5.1.0.14.0.20040505164239.00b8e398@mail.ionzoft.com> In-Reply-To: <5.1.0.14.0.20040505164239.00b8e398@mail.ionzoft.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] constant name From: didou@keliglia.com (Mehdi Achour) barfoo (c/p error) Jason Garber wrote: > Does it output "barfoo" or "bar"? > ~Jason > > > At 5/5/2004 10:01 PM +0200, Mehdi Achour wrote: > Hi ! > > The manual reads : > > "The name of a constant follows the same rules as any label in PHP. A > valid constant name starts with a letter or underscore, followed > by any number of letters, numbers, or underscores. As a regular > expression, it would be expressed thusly: > '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]'" > > > I know that this is true when trying to echo a constant directly, as the > parser raise an error, but you can trick it with a constant() call : > > > define(' > (\ /) > {=B0_=B0) > () () > ( )( ) > ', 'barfoo'); > > echo constant(' > (\ /) > {=B0_=B0) > () () > ( )( ) > ') . chr(10); // outputs : bar > > Is it a feature or a bug ? :) > > Mehdi Achour >