Re: Reporting bugs for phpng
| From: | Pierre Joye | Date: | Mon, 04 Aug 2014 17:06:24 +0000 |
| Subject: | Re: Reporting bugs for phpng | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76339@lists.php.net to get a copy of this message | ||
hi Dmitry,
On Mon, Aug 4, 2014 at 6:23 PM, Dmitry Stogov <dmitry@zend.com> wrote:
> hi Pascal,
>
> Laruence is right - immutable arrays are not destroyed until the end of
> request and this causes a problem in your case.
>
> I've committed a partial fix that destroys unnecessary copies when script
> is cached by OPCache, but it doesn't work without opcache or when it
> doesn't have enough shared memory.
>
> Disabling immutable arrays for top-level code looks as a too pessimistic
> decision. Most apps have their configuration arrays in top-level code and
> only few might be affected by this problem...
>
> I think, we may introduce new pragma that might enable/disable immutable
> array creation during compilation.
> So applications that use a lot of big arrays may modify the default
> behaviour for some files.
>
> e.g.
>
> <?php
> declare(immutable_arrays=>'off');
> $a = array(...);
> ?>
>
> Thoughts?
As I agree that a solution has to be found, introducing pragma is
definitively not something I like to see in PHP, options like that are
way too low level and should not be exposed in userland. It will make
PHP way too complex.
Cheers,
Pierre