Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-03-14 Thread tyson andre
Hi internals, One idea I had that was related to this (but not in the scope of this RFC) would be adding a way to force the interpreter to treat an argument (variable, array field, property access, etc) as being passed by value, and refuse to modify it by reference (e.g. emit a notice and create

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-24 Thread Mike Schinkel
> On Feb 23, 2020, at 9:23 AM, Rowan Tommins wrote: > > Hi Mike, > > First, I'd just like to reiterate that I absolutely see benefits in this > proposal, and am definitely not campaigning for it to be abandoned as a bad > idea. Like with any proposal, we have to weigh those benefits against th

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-23 Thread Rowan Tommins
On 23/02/2020 09:47, Nikita Popov wrote: The prefer-ref/prefer-val thing is indeed a bit peculiar. It's an artifact of the current way of implicit by-reference passing, where the decision of whether to pass by-value or by-reference has to be made based on an "educated guess" at the call-site. T

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-23 Thread Rowan Tommins
Hi Mike, First, I'd just like to reiterate that I absolutely see benefits in this proposal, and am definitely not campaigning for it to be abandoned as a bad idea. Like with any proposal, we have to weigh those benefits against the costs, and my current personal opinion is that the scales com

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-23 Thread Nikita Popov
On Fri, Feb 21, 2020 at 11:20 PM Rowan Tommins wrote: > On 20 February 2020 14:13:58 GMT+00:00, Nikita Popov > wrote: > >Hi internals, > > > >I'd like to start the discussion on the "explicit call-site > >pass-by-reference" RFC again: > >https://wiki.php.net/rfc/explicit_send_by_ref > > > Hi Nik

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-22 Thread Mike Schinkel
> On Feb 23, 2020, at 2:00 AM, Mike Schinkel wrote: > On Feb 22, 2020, at 5:56 AM, Rowan Tommins wrote: >> One of the reasons it is confusing is because developers are currently >> required to use the ampersand in one place and not the other. Making >> it always used removes said confusion as

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-22 Thread Rowan Tommins
On 22 February 2020 06:50:46 GMT+00:00, Mike Schinkel wrote: >> On Feb 21, 2020, at 5:20 PM, Rowan Tommins >wrote: >> My instinctive reaction is still one of frustration that the pain of >removing call-site ampersands was in vain, and I will now be asked to >put most of them back in. > >That is

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-21 Thread Mike Schinkel
> On Feb 21, 2020, at 5:20 PM, Rowan Tommins wrote: > > On 20 February 2020 14:13:58 GMT+00:00, Nikita Popov > wrote: >> Hi internals, >> >> I'd like to start the discussion on the "explicit call-site >> pass-by-reference" RFC again: >> https://wiki.php.net/rfc/explicit_send_by_ref > > My ins

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-21 Thread Rowan Tommins
On 20 February 2020 14:13:58 GMT+00:00, Nikita Popov wrote: >Hi internals, > >I'd like to start the discussion on the "explicit call-site >pass-by-reference" RFC again: >https://wiki.php.net/rfc/explicit_send_by_ref Hi Nikita, Thanks for putting the case for this so clearly. My instinctive rea

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-21 Thread Nikita Popov
On Fri, Feb 21, 2020 at 12:05 AM Larry Garfield wrote: > On Thu, Feb 20, 2020, at 8:47 AM, Levi Morrison via internals wrote: > > Just chiming in to voice strong support for this RFC. This is a key > > piece toward making PHP code statically analyzable. If it becomes > > required at the call site

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Matthew Brown
This proposal is great, but most PHP static analysis tools already do a reasonable job of understanding by-reference assignment and detecting bugs there (an exception is closure use by-reference checks, which is a static-analysis no-man's land). No static analysis tools catch your specific use-cas

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Mike Schinkel
> On Feb 20, 2020, at 9:13 AM, Nikita Popov wrote: > > I'd like to start the discussion on the "explicit call-site > pass-by-reference" RFC again: > https://wiki.php.net/rfc/explicit_send_by_ref > On Feb 20, 2020, at 6:04 PM, Larry Garfield wrote: > > If $this->data is itself an object, then y

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Christian Schneider
Am 21.02.2020 um 00:04 schrieb Larry Garfield : > On Thu, Feb 20, 2020, at 8:47 AM, Levi Morrison via internals wrote: >> Just chiming in to voice strong support for this RFC. This is a key >> piece toward making PHP code statically analyzable. If it becomes >> required at the call site, such as in

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Larry Garfield
On Thu, Feb 20, 2020, at 8:47 AM, Levi Morrison via internals wrote: > Just chiming in to voice strong support for this RFC. This is a key > piece toward making PHP code statically analyzable. If it becomes > required at the call site, such as in an edition of the language, it > will significantly

Re: [PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Levi Morrison via internals
Just chiming in to voice strong support for this RFC. This is a key piece toward making PHP code statically analyzable. If it becomes required at the call site, such as in an edition of the language, it will significantly enhance the ability to reason about code and probably make it more correct as

[PHP-DEV] [RFC] Explicit call-site pass-by-reference (again)

2020-02-20 Thread Nikita Popov
Hi internals, I'd like to start the discussion on the "explicit call-site pass-by-reference" RFC again: https://wiki.php.net/rfc/explicit_send_by_ref The RFC proposes to allow using a "&" marker at the call-site (in addition to the declaration-site) when by-reference passing is used. Relative to