Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14282 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45476 invoked by uid 1010); 5 Jan 2005 00:29:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45440 invoked by uid 1007); 5 Jan 2005 00:29:57 -0000 Message-ID: <20050105002957.45371.qmail@pb1.pair.com> To: internals@lists.php.net, Jochem Maas Date: Wed, 05 Jan 2005 00:29:31 +0100 References: <41DB2D85.1080700@iamjochem.com> Lines: 40 User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Posted-By: 84.128.46.246 Subject: Re: CONSTANT names... From: johannes@php.net (Johannes Schlueter) Hi Jochem, you can get the valu of that constant with the constant() function and use such a constant with defined() so forbidding this would at least be a BC break. btw. the same goes for reserved words so define('echo', 42); is valid too but "echo echo;" doesn't work :-) johannes Jochem Maas wrote: > hi guys, > > I was mucking around and noticed the following: > > define("404_SKIP", 1); > > does not give an error and you can successfully get the value of the > constant by doing: > > constant("404_SKIP"); > > where as doing: > > echo 404_SKIP; > > gives an error. > as I understand it, i.e. what the docs say, is that the following regexp > expresses valid starting chars for the name of a constant (the same > going for vars): > > /^[a-zA-Z_\x7f-\xff]/ > > so pretty minor thing here but I expected to see the define() throw a > (fatal?) error, rather than letting me go on. > > kind regards, > Jochem