Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67884 invoked from network); 20 Nov 2013 20:56:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2013 20:56:10 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:51355] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/62-51208-8E12D825 for ; Wed, 20 Nov 2013 15:56:09 -0500 Received: by mail-la0-f53.google.com with SMTP id ea20so7885855lab.12 for ; Wed, 20 Nov 2013 12:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=gPxQ4hAAyqSU9CmDMPejMgyGbfzh+Z1P/gffQv8pOLk=; b=DQ49ckFhSCdT+/5Z0671Kd9NjDTkeTfUuSWif1s+mSuUV5zSqm1avvNOBhofuVMZ42 gXNcS8NG6KA82p52HJXzRLIZVVOzW5OOy0t9Ipwk0xLYvx79UMXAppcR74FL1XKq0dAE 8kB6fyHZ4VmXhwFkItIgpTcOK3VYPbhTO5bWzAN9S3zcWk6hj6q0A7BN7F8wQe1Jvqls oeifo68B1TY7jUCxTI6Nq3raUSSbUQtkw45iPyggPlJ4u1KYH+ASidBMVyF7Zjj8QoeY 7letVte2hnxBSziHHa3fUlfYmPm5qL+uiYoh/6K5h6NuIrmhmEPjBdr5sMp4ClrCBHxt mA3w== X-Received: by 10.152.181.98 with SMTP id dv2mr1924909lac.15.1384980965500; Wed, 20 Nov 2013 12:56:05 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Wed, 20 Nov 2013 12:55:24 -0800 (PST) In-Reply-To: References: Date: Thu, 21 Nov 2013 05:55:24 +0900 X-Google-Sender-Auth: n4-hGNr0QbJDf3MtAcJitcWhN7k Message-ID: To: Bob Weinand Cc: List PHP Mailing List Content-Type: multipart/alternative; boundary=001a113413c6782e2704eba20221 Subject: Re: [PHP-DEV] [RFC] [VOTE] Constant scalar expressions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113413c6782e2704eba20221 Content-Type: text/plain; charset=UTF-8 Hi Bob, On Thu, Nov 21, 2013 at 5:17 AM, Bob Weinand wrote: > 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] == "include") > include 'b.php'; > const B = A; > > b.php: > const A = 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. > I thought whole point of introducing "const" while we have define() was to make constant cachable in ops. Anyway, I'll vote 'yes' in that case. Thank you. BTW, any reason why there is no constant array? -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113413c6782e2704eba20221--