Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101260 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60161 invoked from network); 7 Dec 2017 02:04:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2017 02:04:12 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.44 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.44 mail-pg0-f44.google.com Received: from [74.125.83.44] ([74.125.83.44:39285] helo=mail-pg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/95-24804-991A82A5 for ; Wed, 06 Dec 2017 21:04:09 -0500 Received: by mail-pg0-f44.google.com with SMTP id w7so3352545pgv.6 for ; Wed, 06 Dec 2017 18:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=0pZR4kno1ifEO84xOt9IY9HtlXO+P6cbFvtGTC3UDBw=; b=LTLqJ4mESmKiCAqDbVFvF1e0uGigXuNHBOVu8mu5C/3kjk+5b0+PPvhrJjixTBOG/B deoGTRtEM3mdbITh0h+reCSAXUoyHGS4kIOj8xSBzXk5TKbhsxZoUeIYNHcpdqDXjfcz 4s3637Vlg/UshbAozysRdYIbzopBKHouTMbxqWY/57JSImqDvbgE+pzlggfS2ipzPGu1 Ccc/+9d38xdLpo7cDIMwsJjIFzrmBnvPKHSdNqLmJbfBJvlW3yl9cNwYL/gZUVBpdqZV dgEfP9VrODa33UesX7E1KSrKLyNRS1c/4ticWnu1jNiKxeCD7yPmAxIZxFDHRYOy03KD +yMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0pZR4kno1ifEO84xOt9IY9HtlXO+P6cbFvtGTC3UDBw=; b=npTCU7hnLzyEq4HzTzIBt5J+4yOVNMWb9PNSqwMJPoMZ8PzUR8fIqYhNXqrg5KPprG rkPpcWjm/LOkZncAX5IK+ljI873BtddV4fzcbDw53LfUNX/va8LjP/fa3yOIKxVAnOcV b1jNJ3+LFtYTFLiUvc2SfljFcxHk674eVEawxat4o4ZhsJke1cy/ZUxFsaT8uA48aw0G hpm1N0nGRrjgA337POHvOhtj94GhXXkH2q8gilkYSeevBtPRZiHPnJR9Tbazbt0cr+K7 ScNokFo5PiF8ehD8tBkBLA7523sr6eWDKWAUldJuwycbhLHDMVm8XwTvv1oprWFZBTbK nOgw== X-Gm-Message-State: AJaThX4grqE19ujhcyv0tmuaCQ6sXbifsUb4d3jRlL8OvcbyggRUl9eB J9ni/KvPrft5nldeMBJZ1hYs/U0= X-Google-Smtp-Source: AGs4zMYuHgZC7XMXCDZzz6mb0APvNt1Xk2diX84RcwOLvZMLNRWE3Md2Vmba09ajkIqBaQ52LEV41g== X-Received: by 10.99.103.70 with SMTP id b67mr23304141pgc.211.1512612246164; Wed, 06 Dec 2017 18:04:06 -0800 (PST) Received: from Stas-Pro-2016.local (c-73-71-144-171.hsd1.ca.comcast.net. [73.71.144.171]) by smtp.gmail.com with ESMTPSA id c24sm6508539pfl.2.2017.12.06.18.04.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 18:04:05 -0800 (PST) To: Nikita Popov , PHP internals References: Message-ID: <8f7ea4cc-238a-cc01-6597-1961a2171dc3@gmail.com> Date: Wed, 6 Dec 2017 18:04:04 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 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. We had usage of this syntax for similar, but different purpose before it was removed. Reinstating it now would be confusing, and generally not a good practice - having one syntax mean different things in different PHP versions is not good. It is not likely that we'd ever want to make it mandatory, due to the overwhelming mass of code relying on the current syntax, and without it instead of making code more clear, it would make it more confusing - if & means by-ref, does absence of it mean by-value? Nope. So you still have to check. Unless of course you rework all existing code to add & - which would be rather hard and will make it incompatible with every currently supported version of PHP. All this to achieve no other benefit but a purely cosmetic one which a good IDE could easily deliver to you for free without changing language syntax. I do not think it is worth it. -- Stas Malyshev smalyshev@gmail.com