Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106292 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75629 invoked from network); 25 Jul 2019 15:08:53 -0000 Received: from unknown (HELO mail-lj1-f178.google.com) (209.85.208.178) by pb1.pair.com with SMTP; 25 Jul 2019 15:08:53 -0000 Received: by mail-lj1-f178.google.com with SMTP id t28so47813845lje.9 for ; Thu, 25 Jul 2019 05:32:32 -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=ho+282nJXJIplVvh4nmXCs0W5pUUPh2zOCTD+Yer3Z0=; b=Ycur9Na61U9tVb/p3FYXXICm0ex/FXM9LMm9vumDKBx9dkt7VmbX9xZ2y5EWTyP03p ia+qgXkTRSxpiRxLERXin+UIz4m0j/OWbdwGvRNfIFKQGI1ORO+nV1R1GS3U9LsZ4ds2 x2vpW4czg20bfaVWnbWmMEFFk+DndV0Ld9OH/Rmpx4nYY/fYUWE0GtdCqmbyj7U/DXZb kGsHfGkPWXLdg3vYMyk3QbVhyqzfElUO3kpR/MtG5XRuu9jjG7Fw1e9IGnSD1Sgz7CFu G6VK7cPG4xBFCSqZo62GGKkrUEOqUNoE9a9rhyhtXF3l32JG3qKF3HN4mRaMHErPKxBP s9tA== 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=ho+282nJXJIplVvh4nmXCs0W5pUUPh2zOCTD+Yer3Z0=; b=AO4gCRVcFcLWjHA5MsBPDXgQkxxG7GXW+APC08dDTtuQ9K0qEp7z+7d6jlbSyRb02z LvXVsXr0tiw/XMNiTia+75m9LIaEiD4NE77+AeSR8U9qhgOtKJoQXdd7aV+SLs+lRGV+ NfR4TBqtmL4sYE2Z0cubk8n+lO90XUDSBrJqJ97BSfR60iBFWiM52hCLuSgjs4XNVSF7 qBAw2vlXOFcRlegep1S5WViSsKLd+16PZVnuiBzi46syvIG4wn2Y73tY0RAVKXR6jBRS oH4j0uPsQgJtq+AEtDLPN965lvUll0lc6p3dzpZGLL8+Et0Oz9cpghZkmYeUOtrmlIHT 6uwQ== X-Gm-Message-State: APjAAAWVuZmaebWnwRui9L/0c9rGwggx34CJ4BazJ/8ZTEWPXsX02hX1 lc4H/bGwfn1vkHuI17YlgTMJ7r/eJnsdrvWtUS+a9jC2Y1vkaw== X-Google-Smtp-Source: APXvYqyYiDOGxqDypn/qvpU8yKZWC7o+cDoIMQC/Cc14s7HKwV2XYgWCWADENnFTzMJrTFrmfUqTpWlqD2qMT9+8L3s= X-Received: by 2002:a2e:3e01:: with SMTP id l1mr24289448lja.208.1564057951489; Thu, 25 Jul 2019 05:32:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 25 Jul 2019 14:32:14 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000009b5169058e809e2d" Subject: Re: [RFC] Explicit call-site send-by-ref syntax From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009b5169058e809e2d Content-Type: text/plain; charset="UTF-8" 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_send_by_ref > > In short, while currently we have > > function byRef(&$ref) {...} > byRef($var); > > this proposal would also allow > > function byRef(&$ref) {...} > byRef(&$var); > > so that the use of by-reference passing is obvious without having to > consult the function declaration. > > Regards, > Nikita > I've rebased and finished the implementation for this and would like to move forward with this RFC. 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. Or I could first try to push through https://wiki.php.net/rfc/namespace_scoped_declares or some variant thereof so that call-site reference passing annotations can be made required on a per-library/project basis. As most of the feedback here has been on whether this is really worthwhile if it's only optional, I guess the second option would be preferred? Nikita --0000000000009b5169058e809e2d--