Re: [RFC] [VOTE] Constant scalar expressions
| From: | Yasuo Ohgaki | Date: | Wed, 20 Nov 2013 20:55:24 +0000 |
| Subject: | Re: [RFC] [VOTE] Constant scalar expressions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70247@lists.php.net to get a copy of this message | ||
Hi Bob,
On Thu, Nov 21, 2013 at 5:17 AM, Bob Weinand <bobwei9@hotmail.com> 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