On 2 June 2017 14:21:38 BST, "Bartłomiej Krukowski" 
<krukowski.bartlom...@gmail.com> wrote:
> There is an
>option to
>use variable as implicit reference (@see example -
>http://ideone.com/T6oF7C
><http://ideone.com/T6oF7C>), I think it should not be possible. Only
>explicit references should be allowed (except objects).

So in summary: a function given an array (or object) containing items assigned 
by reference can unknowingly "leak" its internal processing of that array.

It's certainly an interesting case, but what is the alternative behaviour you 
would propose? Just banning all assignment to array items by reference would 
stop this, but also remove a potentially useful feature.

Detecting or defeating this situation at the time a function is called might 
prove expensive in terms of processing and memory (e.g. unnecessarily cloning 
values), and the result would be a compatibility break for anyone using this, 
so it would require careful consideration.


[Note: the convention on this list is to reply below quoted text, not above, 
when replying.]

Regards,

-- 
Rowan Collins
[IMSoP]

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

Reply via email to