On Fri, 8 May 2020 at 07:49, Manuel Canga <p...@manuelcanga.dev> wrote: > > What is your opinion ? Do you see it useful ?
I can see the need; I strongly dislike the idea of using references for this. What you're describing is a form of 'out parameters' which have been mentioned a few times before on this list. I've made a note of the general idea here: https://github.com/Danack/RfcCodex/blob/master/out_parameters.md Though the wikipedia article is also good: https://en.wikipedia.org/wiki/Parameter_(computer_programming)#Output_parameters Using references for things like this is a bad idea as references make it hard to reason about code. In this specific case, having the function mutate the existing variable is horrible. > If nobody objects to this RFC While you categorically must do what you must, I don't think you will get much benefit from raising this as an RFC until you find someone who can and is willing to implement it. Actually, just finding any core contributor who is willing to say that they would back this idea might be a good idea. And yes, phpinternals could still really do with an 'informal but only to open to voters' feedback mechanism. Someone should do something about that....wait I'm _someone_. And I have wiki permissions. So here's a page for a non-binding 'indication of interest' poll: https://wiki.php.net/indication_of_interest/keep_type_of_reference_params If anyone disagrees with the text, either please suggest a change or edit it if you have karma. cheers Dan Ack -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php