Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106343 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46058 invoked from network); 30 Jul 2019 13:04:01 -0000 Received: from unknown (HELO mail-lf1-f54.google.com) (209.85.167.54) by pb1.pair.com with SMTP; 30 Jul 2019 13:04:01 -0000 Received: by mail-lf1-f54.google.com with SMTP id z15so40057934lfh.13 for ; Tue, 30 Jul 2019 03:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7MY4sZ81J88pZwTakyP7+nvRTR1gzdVGrh9GhnRQAL8=; b=cgGDM0dUjG+q1ntPlVPKQixdLW2ebg1rPUiiVzQTIyX1pCM1RJ0r9eR/5imGsGES9/ LkqzCHHLXN9utrs7jwI/LVxshwAyi8ihkwmSMcAh10/lBSg/Fu3+x7SW5dckvOG0M8Ej lMqr/B/syoN3821NeBJmPRRuyqq3BBRMTSFkF7UYHyV4IdCsRqY/j45sx3wDzDVKk8RN yNDzvsndGz7qvD6uceYqMX4sWBqG7Hsdio5T3rgQVSgdyjdC2nt86r4ts4T9BI1tmvr/ XH8DrJe1Nx7Wf7PliwjXckytTgc7jlOerquv68PHBOC8AhqA6ma6iTQPUcgEwn0DgmjJ UEUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7MY4sZ81J88pZwTakyP7+nvRTR1gzdVGrh9GhnRQAL8=; b=LszcBowzN1128Cc/QJJkGXT4Q1raqam0+4xVXpmgReh/v1MkFkU1IoTk4zgFqPCQQM 9yszbWH96358j4E/XM1tALXhmA+4sH2ns0r4R/sjKCGjQICjdhWiz7SvVkjnnVFnwglX WbTZJ5WoymmdExpOWxuy/orRNtFXde5sl4Q6JiIJI6hUrAoN/aByQ5+ttJ2bOEDlzxqQ RgtBjhq3gYSk7zvsoSxMz8Dg73O/UKYZ004dwvCvq17wn9zPm7UIoGAT5gG8ZPMZJZdD gkn4Gd+/U56GIJOIt4vyOVS3rUjPmB+DKe0MCb8CPz7rTM0Xd5oGD1z/5pU/71EWiZrj iBlQ== X-Gm-Message-State: APjAAAW0VLRtuLWQdkmKnXUWp8LjuFJsfgJwj4+6aFTSAihtJ5l+aTcA /BCiA6XBg2SDUipacUMwm1cQsGFhQD02gIOTJNw= X-Google-Smtp-Source: APXvYqyytI9+fH20Npx++jCDoqvfMeY6MyzvvnbCPZbXRh3F9rXMzHt7999eyx0hjAi1jC5M3T29f6MmyRm7Wpi4A1c= X-Received: by 2002:ac2:4a78:: with SMTP id q24mr11471787lfp.59.1564482532744; Tue, 30 Jul 2019 03:28:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 30 Jul 2019 12:28:36 +0200 Message-ID: To: Nicolas Grekas Cc: Rowan Collins , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000009f2447058ee3799f" Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009f2447058ee3799f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 30, 2019 at 11:01 AM Nicolas Grekas < nicolas.grekas+php@gmail.com> wrote: > Le mar. 30 juil. 2019 =C3=A0 10:34, Rowan Collins a > =C3=A9crit : > > > On Tue, 30 Jul 2019 at 07:14, Nicolas Grekas > > wrote: > > > > > I think enough time has passed since php4's call-by-ref for the synta= x > to > > > be > > > reused now. I think it's unfair to call the RFC a reminiscent of > > > call-by-ref BTW. > > > > > > > > > Firstly, please let's stop calling this a "PHP 4" feature. It was fully > > supported right up to 5.2, deprecated in 5.3, and only removed in 5.4. > > > > Secondly, I completely disagree that it's unfair to compare the two. Th= e > > syntax being proposed in this RFC (& at both call-site and > definition-site) > > was supported by versions prior to PHP 5.4. Those versions left it > optional > > at either side, which was certainly a mistake; but it was perfectly > > possible (and probably common) for coding standards to require it in bo= th > > locations. > > > > It might be a good idea to include a more thorough discussion of this > > history in the RFC. > > > > Call-time pass-by-reference is deprecated since PHP 4.3.0 and triggers a > deprecation warning since then: > https://3v4l.org/MFXsJ > > That's since Dec 2002. > Disclaimer: I started using PHP somewhere around PHP 5.2 times and have never encountered call-time pass-by-reference as anything but a historical concern, so I'm finding it somewhat hard to empathize with the associated emotional baggage the issue may have. With that in mind, I don't see an issue with reusing the previous call-time pass-by-ref syntax here. The & at the call-site still means that the value is going to be passed by refrence (or error), so it's not like someone who was around during the call-time pass-by-ref times would misunderstand what the code does based on their prior knowledge. The only concern I see here is the emotional issue: Bringing & back as a call-site annotation is an admission that the original migration of by-ref passing has been badly botched: Yes, you removed those & at the call-site for nothing. Yes, you shouldn't have been forced to do that! Mistakes happen and hindsight is 20/20. But we should own up to those mistakes. Regards, Nikita --0000000000009f2447058ee3799f--