Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92172 invoked from network); 14 Aug 2013 06:23:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2013 06:23:05 -0000 Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:59994] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/2E-06453-9422B025 for ; Wed, 14 Aug 2013 02:23:05 -0400 Received: by mail-wi0-f178.google.com with SMTP id j17so1523910wiw.5 for ; Tue, 13 Aug 2013 23:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5Ufeu7a9+oPS/Bs59Ekel65NNtZXLp6ksonglCWYHA4=; b=bdCOh0DfdVuGx+RnBsJ2Y/+a4Iq9bW1Dly7Pg7AAd9Dg/4Fs4/V6w2ifuaVzWcSc3d 5PO1MNU1dvrOOD0+ZbBv7z7tCgQk6ClgvnH+E7a+BD3GJyVV5tc0RpbXl8fMV1Oim8tt Vu3QkQQ2SqPTcpGM5iZ3he4ne5uShzc20BzijOHUQFaUGNlrxw6tgv17qTRATp0Fg5IS SUV1uXy8mfUQyp6uNMUObf06YZ1h1wUpbILwtAU+VMVPcQXNg8BcDIXI2TPTXeslZ4lN Adi9E21Rctt3FUp6hITidhnM4P4LSu8lc12Y860ONEghOwcrDAU/VzPnlGdUGRzB5vgO KBuw== MIME-Version: 1.0 X-Received: by 10.180.109.167 with SMTP id ht7mr4986453wib.45.1376461382722; Tue, 13 Aug 2013 23:23:02 -0700 (PDT) Received: by 10.216.5.9 with HTTP; Tue, 13 Aug 2013 23:23:02 -0700 (PDT) Received: by 10.216.5.9 with HTTP; Tue, 13 Aug 2013 23:23:02 -0700 (PDT) In-Reply-To: <4ED7146272E04A47B986ED49E771E347BB514EEE88@Ikarus.ameusgmbh.intern> References: <4ED7146272E04A47B986ED49E771E347BB514EEE88@Ikarus.ameusgmbh.intern> Date: Wed, 14 Aug 2013 08:23:02 +0200 Message-ID: To: Christian Stoller Cc: PHP internals list , Anthony Ferrara Content-Type: multipart/alternative; boundary=e89a8f3ba7e1c3aa5304e3e263be Subject: RE: [PHP-DEV] [RFC] Constant Scalar Expressions From: krebs.seb@gmail.com (Sebastian Krebs) --e89a8f3ba7e1c3aa5304e3e263be Content-Type: text/plain; charset=ISO-8859-1 Am 14.08.2013 08:17 schrieb "Christian Stoller" : > > > Hello all, > > > > I'd like to propose a new RFC for 5.NEXT: > > > > https://wiki.php.net/rfc/const_scalar_expressions > > > > This allows for defining constant expressions which are resolved at compile > > time. > > What should that be for? > > > const FOO = 1 + 1; > > const BAZ = "HELLO " . "WORLD!"; > > Why not just writing > > const FOO = 2; > const BAZ = "HELLO WORLD!"; > > I think it makes code les readable. And if you want to give an important hint for the reader of the code, you can still write comments. Other examples are better I think const $flag3 = 1<<7; const $timeout = 60*8; For strings it can make sense to avoid newlines, when you want to split a long string onto several lines. > > > Best regards > Christian --e89a8f3ba7e1c3aa5304e3e263be--