Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:809 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88400 invoked from network); 8 Apr 2003 21:34:01 -0000 Received: from unknown (HELO localhost.localdomain) (67.38.12.215) by pb1.pair.com with SMTP; 8 Apr 2003 21:34:01 -0000 Received: from cooglewin ([192.168.1.109]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id h38JZLB11877; Tue, 8 Apr 2003 15:35:27 -0400 To: , Date: Tue, 8 Apr 2003 17:33:51 -0400 Message-ID: <001201c2fe16$900b9910$6d01a8c0@cooglewin> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: Importance: Normal Subject: Preprocessor? From: john@coggeshall.org ("John Coggeshall") References: I've been thinking about this for awhile, and seeing these patches about 'const' at compile-time I thought I would throw this in here now... Instead of patching the engine for these constant values, wouldn't these things be better served in a module? I've already worked on a basic module that hooks into zend_compile() and does pre-processing before giving the script over to PHP... Hence you'd have something identical to C's preprocessing. If there is interest, I'd like to be able to include this module in PHP5 once its been cleaned up... John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >-----Original Message----- >From: Chris Vandomelen [mailto:chrisv@revhosting.com] >Sent: Tuesday, April 08, 2003 3:45 PM >To: internals@lists.php.net >Subject: [PHP-DEV] [PATCH] 'const' in global scope > > >In tune with the current 'const' patches by Sterling, and >because I found it useful (and more consistent than the >original behaviour IMHO), attached is a patch which implements >compile-time constants in the global scope: > > >const something = 2, something_else = 4; > >?> > >The behaviour is the same as define(), only implemented in the >compiler instead of as a function. > >Chris >