Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88441 invoked from network); 8 Apr 2003 10:37:21 -0000 Received: from unknown (HELO ogi.bezeqint.net) (192.115.106.14) by pb1.pair.com with SMTP; 8 Apr 2003 10:37:21 -0000 Received: from mr1.bezeqint.net (pip-17.bezeqint.net [192.115.106.17]) by ogi.bezeqint.net (Bezeq International SMTP out Mail Server) with ESMTP id E89E137A2 for ; Tue, 8 Apr 2003 13:36:34 +0300 (IDT) Received: from mail.zend.com (bzq-117-235-230.cust.bezeqint.net [192.117.235.230]) by mr1.bezeqint.net (Mirapoint Messaging Server MOS 3.3.3-GR) with SMTP id AWA90729; Tue, 8 Apr 2003 13:37:10 +0300 (IDT) Received: (qmail 1669 invoked from network); 8 Apr 2003 10:37:06 -0000 Received: from localhost (HELO zeev-laptop.zend.com) (127.0.0.1) by localhost with SMTP; 8 Apr 2003 10:37:06 -0000 Reply-To: zeev@zend.com Message-ID: <5.1.0.14.2.20030408133219.05b16140@localhost> X-Sender: zeev@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 08 Apr 2003 13:37:04 +0300 To: Sterling Hughes Cc: internals@lists.php.net In-Reply-To: <1049764010.24472.618.camel@hasele> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] [PATCH] Allow constant expressions From: zeev@zend.com (Zeev Suraski) References: <1049764010.24472.618.camel@hasele> Nice patch, but one problem - it allows users to use constants as a part of those expressions... Since the values of those are not known until compile time, we have an issue there. Technically we can disallow such constants from being used in those expressions, but I'm not sure how well we can explain this (you can use constants, but not in expressions?) I don't know, maybe it's an ok thing to say. Zeev At 04:06 08/04/2003, Sterling Hughes wrote: >Hi, > >The attached patch allows constant expressions within class variables >and constants. I came into this problem when I wanted the following >sequence: > >class foo { > const A = 1<<0; > const B = 1<<1; > const C = 1<<2; >} > >And the current parser doesn't allow such rules. I therefore added the >attached patch which allows operators to be used on constants within >these expressions (and also within array declarations). This is >achieved by folding statements such as '1<<0' into their equivalent >values at compile time. The following operators are supported: << >> | >& + - * / . % ^ ~ xor > >Please review it, and let me know if its ok to commit. :) > >-Sterling > >-- >"People can have the Model T in any colour -- so long as it's black." > - Henry Ford > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php