Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16686 invoked from network); 7 Nov 2013 12:36:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2013 12:36:52 -0000 Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain strojny.net from 46.4.40.248 cause and error) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 46.4.40.248 milch.schokokeks.org Received: from [46.4.40.248] ([46.4.40.248:49209] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/00-16506-2698B725 for ; Thu, 07 Nov 2013 07:36:51 -0500 Received: from [192.168.1.137] (p5099f5c8.dip0.t-ipconnect.de [::ffff:80.153.245.200]) (AUTH: PLAIN lars@schokokeks.org, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by milch.schokokeks.org with ESMTPSA; Thu, 07 Nov 2013 13:31:23 +0100 id 0000000000000024.00000000527B8822.00002135 Content-Type: multipart/signed; boundary="Apple-Mail=_3B59318A-28C9-4BF3-A6B8-47216B2D8D28"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) In-Reply-To: Date: Thu, 7 Nov 2013 13:31:14 +0100 Cc: List PHP Mailing List , Dmitry Stogov Message-ID: <4DBA0F2B-4B6B-4A19-9B53-9C16352D1D71@strojny.net> References: To: Bob Weinand X-Mailer: Apple Mail (2.1816) Subject: Re: [PHP-DEV] [RFC] Constant Scalar Expressions (with constants) From: lars@strojny.net (Lars Strojny) --Apple-Mail=_3B59318A-28C9-4BF3-A6B8-47216B2D8D28 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 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 = suggest 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? cu, Lars On 07 Nov 2013, at 13:01, Bob Weinand wrote: > Hi! >=20 > As you all know, Anthony Ferrara had withdrawn his RFC a few months = ago, which was without support for constants in these expressions: >=20 > const foo =3D 10; > const bar =3D 10 * foo; >=20 > The use of a constant in a declaration of a constant was not yet = possible with his patch. >=20 > That's what I changed. >=20 > Enjoy reading the RFC at: >=20 > https://wiki.php.net/rfc/const_scalar_exprs >=20 > Bob Weinand >=20 > 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 --Apple-Mail=_3B59318A-28C9-4BF3-A6B8-47216B2D8D28 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIVAwUBUnuIEyQPF+sCY6wHAQJrcw/+NWqE5NHs2CPpQIX9lo5dLzNDbM3/RCBs 8rbgFK2gmdgKUihF5T3aRw/9uj6CT1Dp5R77NgZ0uFIrA41p1lTo2JYYrpblSJNl OzYft1NXFHtU07W5hGaGoJr2Qe1QOI7mdkuKvUf81BcxOA5CaJhBLr8r3MdjnVLx gLCzCWJyi005+HLrJlf5+mPTetwThiQ6KSS+zg+wOmKUGdNyhw2qfEugPgckARuK HJ26wFJ2oAnEQQuMj1pOQoROqfzEEUtqQmA7IQFzB+nZmTvUXwoHmTdV1niqTv7H j70V8zqu+8fyy5QdRvUSV4ItRiXrq8g+91oQ2V8gWSf+MO9zEw0yji8dF2PJuLqO 6xWFs7Sho9AFw74BtMim9d8m0G2bTaK6A4KPLaTbjsIiwd6s8mFcJkU/jMJn2Cv2 APbZz2IP85viA6xZGX3zk1LMSr4rn+TgSG2qzAdoNcfnTo2XMghitjjft6WwUbpw 2OU4hSTnSusIy5E+7MLBz0JvsqVaKKqx0Egm9jT4BCK9rjBfb2SYSJGouvrJcGyy yBZEDdx4SWVRyR7MbKEIewKwfLU2gJhiomuysLnCoVMSRrF9y0dvK/j7L0gYxODj iCWR+ozHjcI9VXFijS5PnxGDlQ/i1+PoiMz5qw46R37IpvQRcq9kxGkpktJOfcT+ 90zCTttw9QM= =piJJ -----END PGP SIGNATURE----- --Apple-Mail=_3B59318A-28C9-4BF3-A6B8-47216B2D8D28--