Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70051 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19609 invoked from network); 7 Nov 2013 12:44:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2013 12:44:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:60657] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/B0-16506-E0B8B725 for ; Thu, 07 Nov 2013 07:43:59 -0500 Received: by mail-wi0-f182.google.com with SMTP id ez12so530783wid.3 for ; Thu, 07 Nov 2013 04:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=7LgSQ4rNb3Bu/Lh5fHP7FZEuO3OaMY4z50lEHFkXOQE=; b=hyeV/BAnrX98NVulPfjdPhzk9vb1HUifQzW2zU8kWNqlCtS78/6eJ2gOwSV6f3kMGI NQWf1Yg8UNa0QfoQQwfi1pP7DRrJivaqmYWZ8K5ZuioUYk9a1YX/PpLzIBoQYfIN9P5Q RW6PFy8zFc6Y0yaT7SjXyHX+LgM15NmXfiN/V08Q4rNRC+hNI8M+oO4EXjVi3f+6t9WM +8FISBPXLBO9BrTAAFH24XyjzPrUYbZ9iVqOL5AjuA2jHHj0/oK8DEvLDKt71ZkPgAj3 PFc9CnZw9LMBMoMPvI1gppxUqjEiiEssoWsaRZNOPuxV5uIXIjfh2vkr1n6Nqx+hLokM MUfQ== X-Received: by 10.194.104.66 with SMTP id gc2mr1195062wjb.75.1383828236073; Thu, 07 Nov 2013 04:43:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Thu, 7 Nov 2013 04:43:15 -0800 (PST) In-Reply-To: <4DBA0F2B-4B6B-4A19-9B53-9C16352D1D71@strojny.net> References: <4DBA0F2B-4B6B-4A19-9B53-9C16352D1D71@strojny.net> Date: Thu, 7 Nov 2013 13:43:15 +0100 Message-ID: To: Lars Strojny Cc: Bob Weinand , List PHP Mailing List , Dmitry Stogov Content-Type: multipart/alternative; boundary=089e0102ef8471052f04ea959e9b Subject: Re: [PHP-DEV] [RFC] Constant Scalar Expressions (with constants) From: krebs.seb@gmail.com (Sebastian Krebs) --089e0102ef8471052f04ea959e9b Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2013/11/7 Lars Strojny > Hi Bob, > > thanks for your work, it=92s awesome. One thing about constants: > > Take this example: > > const FOO =3D 2; > > class Klass > { > const FOO =3D 1; > const BAR =3D FOO; > } > > Here FOO is ambiguous, as it could resolve to 2 or to 1. If I understood > it correctly, global constants are not yet implemented but I would sugges= t > to always force prefixing the constant to get rid of the ambiguity and > allow for future extension. > > const FOO =3D 2; > > class Klass > { > const FOO =3D 1; > const BAR =3D self::FOO; > } > > Does that make sense? > Yes, also from the consistency point of view: I'd expected to refer class constants via its class name (or self/static). Having to ways to refer them is confusing. > > cu, > Lars > > On 07 Nov 2013, at 13:01, 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 =3D 10; > > const bar =3D 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 > > > > Bob Weinand > > > > Special thanks go to Dmitry who had helped me a lot with feedback and a > deep review of the patch. > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > --=20 github.com/KingCrunch --089e0102ef8471052f04ea959e9b--