hi Dmitry,

On Mon, Aug 4, 2014 at 6:23 PM, Dmitry Stogov <dmi...@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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to