Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59903 invoked from network); 8 Dec 2017 16:56:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2017 16:56:38 -0000 Authentication-Results: pb1.pair.com header.from=lists@rhsoft.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lists@rhsoft.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rhsoft.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: lists@rhsoft.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Received: from [91.118.73.15] ([91.118.73.15:42485] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/D4-11466-444CA2A5 for ; Fri, 08 Dec 2017 11:56:37 -0500 Received: from srv-rhsoft.rhsoft.net (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 3ytdmJ73W3zXMP for ; Fri, 8 Dec 2017 17:56:32 +0100 (CET) To: internals References: <91639df6-4fbd-a649-6558-7ae9130020ff@telia.com> <670DE052-934C-4EFE-9B70-C59736EAFAD1@koalephant.com> <2dd0e62d-1885-08d3-2ca5-4f6c3c68176f@rhsoft.net> Message-ID: Date: Fri, 8 Dec 2017 17:56:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: lists@rhsoft.net ("lists@rhsoft.net") Am 08.12.2017 um 17:36 schrieb CHU Zhaowei: > On Fri, Dec 8, 2017 06:16 PM, "lists@rhsoft.net" wrote: > > > >and it's much bader to use a not so long existed syntax which was now > >changed to a fatal error - just type "php call-by-reference" in google > > > I know most people of this list using and contributing to PHP for a very > long time, but I want to point out that the old "call-time > pass-by-reference" was deprecated from php 5.3, which is more than 8 > years ago but PHP 5.4 where it changed ot be a fatal error is not that long ago and will live many years because it's part of RHEL7 > People with modern framework and tools are not troubled by > the old and already removed syntax. The real trouble is I cannot figure > out the parameter is passed by reference or value unless I go to the > defination of the method. > btw, I really googled "php call-by-reference", the latest page was post > on 2012, 5 years ago. you can not because people don't use proper comments myfunction /**&$var*/$x); > If you point is pass-by-reference is bad and stupid, then it's off-topic > and I suggest you should create a new RFC to abandon this feature. This > RFC is aimed at making things more clear for developers and static > analyzers my main point was that if you don't make it mandatory it's worth nothing and if you make it mandatory you need to bew aware that this not only affects in PHP written function but also all calls to internal functions which work wit references like sort() and so *a lot* of code written in PHP needs to be touched FRANKLY: if you re-use the syntax and make it mandatoty it's terrible while adopt code because all your existing code won't work with the next PHP version and every adopted line no longer works with the current version because it throws fatal errors you also need to consider adoption of a future PHP version which likely get a heavy impact with syntax changes where the same code has two different meanings while both throw fatal errors in a older or in the next one ________________________ to make things clearer for developers comments where invented - see above - and that most php developers don't wirte well commented and readable code is a completly different story static analyzers - well, i need yet to see one really useable for PHP code, but that#s also a different story the real issue: if the long plan is to make the call syntax mandarory it still should not re-use a syntax which was deprecated and removed years ago because the fact you will find tons of stuff refer to the old one it should really use something else and no re-use