Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64801 invoked from network); 20 Nov 2013 20:18:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2013 20:18:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.167 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.167 blu0-omc4-s28.blu0.hotmail.com Windows 2000 SP4, XP SP1 Received: from [65.55.111.167] ([65.55.111.167:31147] helo=blu0-omc4-s28.blu0.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/D1-51208-AF81D825 for ; Wed, 20 Nov 2013 15:18:02 -0500 Received: from BLU0-SMTP17 ([65.55.111.135]) by blu0-omc4-s28.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 20 Nov 2013 12:18:00 -0800 X-TMN: [LUIAJKbssHR6xJxV01NhZ/ptt/GQ3Tdn] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Received: from bobweinandsimac.fritz.box ([83.99.63.185]) by BLU0-SMTP17.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 20 Nov 2013 12:17:56 -0800 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) In-Reply-To: Date: Wed, 20 Nov 2013 21:17:53 +0100 CC: List PHP Mailing List Content-Transfer-Encoding: quoted-printable References: To: Yasuo Ohgaki X-Mailer: Apple Mail (2.1822) X-OriginalArrivalTime: 20 Nov 2013 20:17:56.0734 (UTC) FILETIME=[99B9F1E0:01CEE62D] Subject: Re: [PHP-DEV] [RFC] [VOTE] Constant scalar expressions From: bobwei9@hotmail.com (Bob Weinand) Am 20.11.2013 um 21:06 schrieb Yasuo Ohgaki : > Hi Bob, >=20 > On Thu, Nov 21, 2013 at 1:54 AM, Bob Weinand = wrote: >=20 >> I just have moved the RFC to vote as there was no negative feedback = nor >> unresolved issues. >>=20 >> Find the vote (and the RFC) at: >>=20 >> https://wiki.php.net/rfc/const_scalar_exprs#vote >>=20 >> Vote will last for one week. >>=20 >=20 > It's nice feature, but I concerned about op caching. > Currently, const is "constant". Therefore, constant value can be = cached > (i.e. hard coded in ops) >=20 > This feature seems break op caching (or close the door for constant > optimization at least) >=20 > Is this a issue? I would like hear opinions from opcache/apc = developers. >=20 > Regards, >=20 > -- > Yasuo Ohgaki > yohgaki@ohgaki.net As noted in the RFC "The patch is ready to be merged. (Opcache support = is included, thanks to Dmitry)". So, Dmitry already did the patch for opcache and I assume he has done = the best possible for that. Btw. opcache doesn't affect constants if I'm not wrong, because, what = would you optimize here (already possible): a.php: if ($argv[1] =3D=3D "include") include 'b.php'; const B =3D A; b.php: const A =3D 10; Here we can't cache anything because the constant B depends on a = conditional inclusion: same problem. It's that same way resolved with the current patch. Also constant expressions (like 2+2 without constants involved) are = resolved at compile time. So I can't detect any impact related to opcache. Bob