Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110085 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84502 invoked from network); 8 May 2020 14:31:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 May 2020 14:31:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 07A0D1804D3 for ; Fri, 8 May 2020 06:07:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 May 2020 06:07:27 -0700 (PDT) Received: by mail-vs1-f54.google.com with SMTP id z1so979589vsn.11 for ; Fri, 08 May 2020 06:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PIopNT5JGy/+zgYOmtPT4q7NieYknmXcpVXeGPCBpTo=; b=xMn3xqcsCc6t41DFf56Quc+IqfeiuOHL1D33NDe/NkVtU5JLq9ijx6j1xW/wW8xodK Cql2/ttSE3ZRkoEze45vyeh+zY/FXEIIhWu3MkrhveTt2DAIUU6Ov60WFInltAmDZ1NZ KwPr4j7lnAJxE5ckzGn4/S4zagvORWNdAWHs3y+w1muXimp+s8FAzKds7KOhk7CsBVAg S9WbRc5iK/u+G1aWCNLY0myyuw+38o7C+UYWBicufOfFGK2we3UyATIp6d4vTBlLXRLU ZjyFiYrnFz7tEzdeH4jAKAwDEFPfO2aADTHBQXxa85rJwnF1oBEehdBihkbcB5gaiNFC XISQ== 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:cc; bh=PIopNT5JGy/+zgYOmtPT4q7NieYknmXcpVXeGPCBpTo=; b=j26xwcOEa+kyzFB0iv3G0kq83ash+itsQQ3kx4iJxvhuGDnZvDQBmpisYUObv2aA5p z9siawDyV8g/tvnDWesrnI72n/3BrrUTAnWbKrY5CZr2vc4wRjvI7t3pd/VgGEc0jdbZ kCVZsH9WzvmblsKclGO0dBfdwARw7XUf2wvja3mH3thpWT54j0S1FshcRI/tdj3XNnA7 RIl92b2S29QkrPe3yuwfbzgjJiMijuANLj4xsP21J87orSMLHUj9PmQXkDxJh2jdJbFo NqMNKZIAV+8IwqolYwn3vS6e4SWcmeYzLO2QTY94EZsIkskuXCh9lQQCFEM8jKWuoBJK SCew== X-Gm-Message-State: AGi0PuZcoBLBUM9icJpoE5wVoAGiVeiQz/mv7Wg3Fao9rRuUMBbuFGeP bkljcoZfljx3YNGj572AuLlTSCg99PTHgKluSFRiZw== X-Google-Smtp-Source: APiQypKT02WKS4SCQwFRVEGh71LNhmu27TlBa+fEwg4UZYshxo3WNi1AFIlOSb/mqBXOHjVSqkhR+TVbmAVCL0Bwn1I= X-Received: by 2002:a67:5c45:: with SMTP id q66mr1713447vsb.46.1588943244124; Fri, 08 May 2020 06:07:24 -0700 (PDT) MIME-Version: 1.0 References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> <171e05b4ced.1041f31b5124598.4028595156690203917@manuelcanga.dev> <10faa29f-f08f-a73e-b76d-683f5abbee86@gmail.com> <171f30b0df0.102b810be444185.2462173785894899100@manuelcanga.dev> In-Reply-To: <171f30b0df0.102b810be444185.2462173785894899100@manuelcanga.dev> Date: Fri, 8 May 2020 14:07:13 +0100 Message-ID: To: Manuel Canga Cc: Rowan Tommins , internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: Danack@basereality.com (Dan Ackroyd) On Fri, 8 May 2020 at 07:49, Manuel Canga 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