Am 08.12.2017 um 17:36 schrieb CHU Zhaowei:
On Fri, Dec 8, 2017 06:16 PM, "li...@rhsoft.net" <li...@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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to