Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106337 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21395 invoked from network); 30 Jul 2019 11:09:39 -0000 Received: from unknown (HELO mail-io1-f51.google.com) (209.85.166.51) by pb1.pair.com with SMTP; 30 Jul 2019 11:09:39 -0000 Received: by mail-io1-f51.google.com with SMTP id s7so126083418iob.11 for ; Tue, 30 Jul 2019 01:34:30 -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; bh=gW3jVRKL3F8/9aEKjpX3GSnZZH8iDepxI1myr8w0L3Y=; b=ko0q0NsBAb0NbGN5r9ZAZHhB7hh+msL26haoNZ0cyaNDp9LJdt4y9WNeOXHGUj6+6X 9B2/CPdODG4ol5MRPxeLGpfkc9x5ZXQVBacN1M1j/YvVIKeRbsr7XhvqYTdzpUMtZv7B sZqrI082j537/Bz/s2DfAIhmtlgdwk+yoqeDeBfkiLU5fq0kGo+WrkGpGhLKTKE0pFO9 RpB9MZGRMo7Kd3rk4RQYb3+kiAklKTBBl8EJkvB4CRZEJSby/rcpg5qMFwbfKMJ4xPkW yNPkwFDlvmspvYeownT+JJdRGSWVOJHexP8/kE16878e/UeH3mIG644p5nR8ocR4ec7B mUHg== 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; bh=gW3jVRKL3F8/9aEKjpX3GSnZZH8iDepxI1myr8w0L3Y=; b=hpbU8YnIOgEvEgE5xWUHey2j6BSfTnUvDL1o4GgzI1pSpVPbFMDZZfUwQdzXqJoAQv Xzb0Uwk5OsBWh8WcuInPN5zg4q5x71T6I5lN00ADfwf7s3UW9Zmn4J87TsQpWaTAvNxZ yOh8x4Q+PosAuqqq3BGwNr7L6fy6mwNXtz0Y50lu4e0weqqJfibxHX+Ir9pD9IyiKIDH GN2oCkMsL8A5Pzw5CO+pqdi75LdYDYlALD1OxniDWiEoKe3RrQHfBup347Bo1QsfdOMY 6e14YS/I84YOA0E4nokhZnHCJMOMybwNu274Qtx0z/6rBw3gcQunkAzCEb2cg/toQmuH vtRA== X-Gm-Message-State: APjAAAX5dQn2DsAXdPojz6g32FBxeHgvnt2S6C7zMTvFKhH8F361nXTI zJlZLdnDSjgLP9OY6dQJo/LCjWm4oTJp+jGFaU9z5Q== X-Google-Smtp-Source: APXvYqwfPxrT+cTy/djeZQ47trqP1tfiSZVwi65p9UfII3LmspbkjhRViwS8mBH0xr6oHMhRGI9AYIeEORJKXypLAg4= X-Received: by 2002:a6b:5b01:: with SMTP id v1mr619951ioh.120.1564475670204; Tue, 30 Jul 2019 01:34:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 30 Jul 2019 09:34:19 +0100 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000009519b1058ee1e0f0" Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: rowan.collins@gmail.com (Rowan Collins) --0000000000009519b1058ee1e0f0 Content-Type: text/plain; charset="UTF-8" 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 syntax 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. The 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 both locations. It might be a good idea to include a more thorough discussion of this history in the RFC. > About requiring such call-annotations using a "declare" directive it feels > like a heated topic. But we don't need it, so let's split it appart. I > could very well see userland tools enforce it at the CS-checking level. > That would provide 99.999% of the target benefit > Unfortunately, it doesn't bring any of the benefits to static analysis that Nikita is proposing. Indeed, it relies on existing static analysers correctly finding the function definition to complain whether the optional & is in place. Including it as optional would certainly bring some benefit to readers, but I think it's a lot less than "99.999%" of what making it mandatory would bring. Regards, -- Rowan Collins [IMSoP] --0000000000009519b1058ee1e0f0--