Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70061 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34847 invoked from network); 7 Nov 2013 13:34:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2013 13:34:14 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:59318] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/B0-31766-3D69B725 for ; Thu, 07 Nov 2013 08:34:13 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 39B40E203A; Thu, 7 Nov 2013 13:34:09 +0000 (GMT) Date: Thu, 7 Nov 2013 13:34:09 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Bob Weinand cc: List PHP Mailing List , Dmitry Stogov In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [RFC] Constant Scalar Expressions (with constants) From: derick@php.net (Derick Rethans) On Thu, 7 Nov 2013, Bob Weinand wrote: > Hi! > > As you all know, Anthony Ferrara had withdrawn his RFC a few months ago, which was without support for constants in these expressions: > > const foo = 10; > const bar = 10 * foo; > > The use of a constant in a declaration of a constant was not yet possible with his patch. > > That's what I changed. > > Enjoy reading the RFC at: > > https://wiki.php.net/rfc/const_scalar_exprs https://github.com/bwoebi/php-src/compare/const_scalar_exprs#diff-4d0b93094aafe8cf519b4f0a3322f471L590 -#define IS_CALLABLE 10 +#define IS_CONSTANT_AST 10 +#define IS_CALLABLE 11 Can I please suggest that you do not change existing constant values? You're using a macro to check for the constant type anyway, so you can do the complex checking for constant types in there. I'm also of the opinion that just " This can allow for writing far easier to understand code, by allowing for far more expressive code." is by far not enough of a justification for a syntax addition. Please please try to be convincing by having good arguments, presenting alternatives and cons. cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine