Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-29 Thread Björn Larsson
Den 2019-07-25 kl. 14:32, skrev Nikita Popov: On Wed, Dec 6, 2017 at 8:49 PM Nikita Popov wrote: Hi internals, I'd like propose optional support for explicitly marking by-reference argument passing at the call-site, in addition to the declaration-site: https://wiki.php.net/rfc/explicit_

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-28 Thread Stanislav Malyshev
Hi! > I do work with code like that: the teams maintaining these codebases are > actively removing by-ref calls when they encounter them.  You seem to be intent on equating your personal experience with needs of every PHP developer on the planet. I can't prevent that but I can say that this exper

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-28 Thread Marco Pivetta
On Sun, Jul 28, 2019 at 9:06 PM Stanislav Malyshev wrote: > Hi! > > > Nah, by-ref is pretty much avoided in OSS packages, but we can surely > > survey the ecosystem to verify this. > > I literally work with code that uses references every day. So may be you > haven't encountered it but the attitu

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-28 Thread Stanislav Malyshev
Hi! > Nah, by-ref is pretty much avoided in OSS packages, but we can surely > survey the ecosystem to verify this. I literally work with code that uses references every day. So may be you haven't encountered it but the attitude of "nah, never happens" I think is a bit misplaced. Also please remem

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-28 Thread Marco Pivetta
On Sun, Jul 28, 2019, 04:47 Stanislav Malyshev wrote: > Hi! > > > I think nowadays it is well known that by-reference passing is to be > > avoided and I don't see it particularly commonly in user code. > By-reference > > I don't think it's true. It depends on the style of coding, of course, > but

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-27 Thread Stanislav Malyshev
Hi! >> In short, while currently we have >> >> function byRef(&$ref) {...} >> byRef($var); >> >> this proposal would also allow >> >> function byRef(&$ref) {...} >> byRef(&$var); I am not sure why it is necessary. If you call a function, one would assume you know what it is doing,

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-27 Thread Stanislav Malyshev
Hi! > I think nowadays it is well known that by-reference passing is to be > avoided and I don't see it particularly commonly in user code. By-reference I don't think it's true. It depends on the style of coding, of course, but there are many situations where the most convenient solution is by-re

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread Rowan Collins
On Thu, 25 Jul 2019 at 16:18, Nikita Popov wrote: >> That would stop people having to write `$matches = []; preg_match($foo, $bar, $matches);` > Eww, please don't write code like that... Huh? How would you write it then? The behavior of type annotations should also change, "out T $x" should >

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread Nikita Popov
On Thu, Jul 25, 2019 at 4:41 PM Rowan Collins wrote: > On Thu, 25 Jul 2019 at 14:48, Nikita Popov wrote: > > > > I think nowadays it is well known that by-reference passing is to be > > avoided and I don't see it particularly commonly in user code. > By-reference > > passing is mainly used when

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread Rowan Collins
On Thu, 25 Jul 2019 at 14:48, Nikita Popov wrote: > I think nowadays it is well known that by-reference passing is to be > avoided and I don't see it particularly commonly in user code. By-reference > passing is mainly used when it is needed to interact with existing > by-reference functions such

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread Nikita Popov
On Thu, Jul 25, 2019 at 3:14 PM Rowan Collins wrote: > On Thu, 25 Jul 2019 at 13:32, Nikita Popov wrote: > > > I think it can either go forward as-is, in that it constitutes the first > > step towards bringing sanity to by-reference passing in the long term. > > > > > Hi Nikita, > > As I mention

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread Rowan Collins
On Thu, 25 Jul 2019 at 13:32, Nikita Popov wrote: > I think it can either go forward as-is, in that it constitutes the first > step towards bringing sanity to by-reference passing in the long term. > Hi Nikita, As I mentioned before, I think this RFC is 10 years too late: if this goes ahead, w

Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax

2019-07-25 Thread G. P. B.
On Thu, 25 Jul 2019 at 14:32, Nikita Popov wrote: > On Wed, Dec 6, 2017 at 8:49 PM Nikita Popov wrote: > > > Hi internals, > > > > I'd like propose optional support for explicitly marking by-reference > > argument passing at the call-site, in addition to the declaration-site: > > > > https:/