Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120616 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53208 invoked from network); 19 Jun 2023 09:47:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jun 2023 09:47:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF97E1804F2 for ; Mon, 19 Jun 2023 02:47:55 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 19 Jun 2023 02:47:52 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2b475b54253so14402301fa.2 for ; Mon, 19 Jun 2023 02:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687168071; x=1689760071; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vSWTRiXgtyaZDNi4lCeMZOp7J5BiPP6+XeZRi9DlzHo=; b=pGzOwV+GdmDzvnQvpt+1pFVeEusg0I3Ozb/0ynHfs8KZL38SYOByJBNdZN50H77uvN MQdOzFK4Y6nT2d1QAiZhiYrsNPCEVF4ZWOVQhl/l+ounYDQom++fQhlQjRjnD5rt732A QlubqnCeGAv7InZMRkHpIYQ78Zuv8kO4FQC6LOwkKCS/cE8GOr6768BE1qtCm2dpgott Df5bgutDaHt32qJ3jRR1abFqwyVFy+BPSoBlie0BCboFCEqhVHCcgEeCB3AYSamRK8xo YkxRxJa69m29Q281z0iYfTPxVCPYXTNkPEL3piQSbN9tq6IhF9+GKrCwe6off7AKlSmZ DzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687168071; x=1689760071; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vSWTRiXgtyaZDNi4lCeMZOp7J5BiPP6+XeZRi9DlzHo=; b=DUYjL/8pvX0CcBVaZc1dQjteA/X4KaJf4w4Tyip/A063wbZiAsYSEskEgjErrDRrlB Wrk4HjT2/GWOdQQShGUudPNC/nO0cEeCtQi/2LpoXn59J52J3/Mq332+UKU5Z6EZybh8 f8J+NF+0uw698l3atfF0llwRqSyYSdmofwDHBIayriowG4X9MWOwyuxdQdGKJ7Q1PorL pNfYZ9EI7Wx8YpBdzfTgAzs7vXOzg61CACya1Btbptp7NUYoxjJvKEA7AFnMVIFQbyVj Rub0HL1tUPINxDx/lFQdINkYdLDFiBuz91Srd5GYo/O1/fzAVjGXkSVdTO/eoD6C3AzL lS0g== X-Gm-Message-State: AC+VfDyVQryx2klc+1Cr2NTrkIi/HbZucs8OEi971TfVSOBe1tNuWDBL GF7mSsCqq5T4KcKbCRYzqU+YI2DVLRLRodmlfe0= X-Google-Smtp-Source: ACHHUZ7yaALDraNa1iSr2WeKokNHA0MEdxqMtK/KhIdyrMcwt9ty35QFMQvfZYOU5Mpm696zLJo3zu1qb4MLx2VLFl4= X-Received: by 2002:a2e:99d3:0:b0:2b4:74ca:43a1 with SMTP id l19-20020a2e99d3000000b002b474ca43a1mr1736627ljj.52.1687168070338; Mon, 19 Jun 2023 02:47:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:9242:0:b0:2b1:a782:3541 with HTTP; Mon, 19 Jun 2023 02:47:49 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Jun 2023 11:47:49 +0200 Message-ID: To: Sam McDonald Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Request to create a RFC for const args From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2023-06-19 9:56 GMT+02:00, Sam McDonald : > Hello php internals team, > I would like to put forward an RFC for a new feature. I am a long time user, > but have never participated as yet to the RFC. > > This is my first step to gather reaction/feedback from the team. > > I would be happy to implement the feature and post a PR or have someone from > the team implement this. > > The feature I want to put forward is "const function arguments" (same for > methods) > > This feature is available in cpp, and I believe would be a benefit to the > php community. > > My RFC would fully detail and clarify what this is and how it works. > > This feature allows the user to specify "const" on a function arg, so that > the argument while in a function can not be reassigned. > > The following example would throw an exception at compile/runtime. > > ``` > public function foo(const int $bar) > { > $bar =3D "buz"; > } > ``` Isn't this similar to my own idea of readonly function arguments? https://externals.io/message/120203#120210 Perhaps more limited in scope? Olle