Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114659 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27110 invoked from network); 28 May 2021 18:47:59 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 28 May 2021 18:47:59 -0000 To: internals@lists.php.net References: Date: Fri, 28 May 2021 20:00:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 87.81.129.66 Subject: Re: [PHP-DEV] A little syntactic sugar on array_* function calls? From: marandall@php.net (Mark Randall) Message-ID: On 28/05/2021 15:31, Nikita Popov wrote: > This is a more complex case. In this case the compiler doesn't know in > advance whether the argument is passed by value or by reference. What > happens here is: I'm trying to wrap my head around this, but if a function arg can handle this, does something internal to the engine preclude fetching in write context, after already fetching in read context, other than performance? So can the initial fetch be performed with FETCH_DIM_R, handling the object case + any other scalars, and if and only if the value is an array and operating on what would traditionally be a by-ref, repeating the previous lookup with FETCH_DIM_W? Mark Randall