Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125417 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 013491A00BD for ; Wed, 4 Sep 2024 15:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725463991; bh=8LfDCRb52PBHIhlNuUBzh0DaQt6PDhOxvssjfpSszMA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VFwNlHLbNl3PPmUNfJ1Sz4bNatgd95F23fpmTo2KZ/PnQUgsbRS7P53jP7r5S9oRc ZbkdpCiF7lDe0ET/uRbsne5imxUiqlN3q5g3eFPl5D3kSlu6TmTyEXkqh9kbXwjILE LZqMaqrA5riga/GZAm9so0HBibiZjF/fvWhutldfgowY5ApKkEw/GI0/RqCkjf9EJB jydt2wXVLl3ysEZ2RTo4XBpvDj9/bBGRPP4pYcXNgDDL5cEZRWw987bBZO1Z97aUwL nFdUA+HXe5Jz/Hwk34+VCIjgjVbGozBnyJSy3wwqdRZ3zHGWmrtZAjhD6vtUrfGZiA zHCYE5qQUsOJA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ED499180055 for ; Wed, 4 Sep 2024 15:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 4 Sep 2024 15:33:07 +0000 (UTC) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-6c91f9fb0acso56776387b3.2 for ; Wed, 04 Sep 2024 08:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725463869; x=1726068669; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8LfDCRb52PBHIhlNuUBzh0DaQt6PDhOxvssjfpSszMA=; b=OMndUiJJ7dMqSxaRbCnBMCgKtLu6ng6qWPxL3H+AHacOwdaBFlsileNoAcojYun7Qr KksVVibxFX3MKZFxVjDbwygO9ytZVuK+BuQtaMW+vR0PhqfpUr19D03P0XNORLiRTXRU hoIwgolN5sJTgitONk/OueXuvjg7Il6ptM+LMxxDl+9Me7hjaZ0RaLbDFpUQqtZgY5+s ZW3pUknehFfPSTCQLadpSa8NtWU0uiQPDPh44F51GHjfM4zZnWX32ml2p9VaRzAS9w6I +p8Ctdz8s1QcMJhxK0s7mrw+rCXEV0CfOSu8LEp/fEuacwjJON8/YS+cLNaROc7ln6bl xE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725463869; x=1726068669; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8LfDCRb52PBHIhlNuUBzh0DaQt6PDhOxvssjfpSszMA=; b=AS6XgIt2/OM30sC9fcOlEqK/3hi8j9YmFC0dtI2euozSqiP4JA895cKFJnThYy67vb xnH7JS9y77XS76HJwe4M6NH2jUg9Q9LkVVB7AahCSVfvq9Arm6kjdvd1LEu7OKyE11Qa 77HqMhupGJP6epm6Jgdp3f0oSw+8B3tlwh9xDn3tCAhnrOWGBBbbaWo0CbRzdR8+iG0C XNUKCJJwnVFXpPj/XQ0zeY66ojtCBvUYS80SRDoAKvK1j+bTNy4DjK2N5ukZT9RupEE4 sJQlIxmm0C7Vh56bv/t2Lf0Z6M9QnhT7sDBN0WkkP8dEz5wZezmgVtT0CCG0+LQCRuQS hn2g== X-Gm-Message-State: AOJu0YwwcK3PfzPIAlj+AViAFm/pTlmE6rkCVsGPJvacx9chGtFUuEii ETbRRqskx6b0JC/4SABnB4V/o5n2oEFRyvy+cn1eGOS7VZVzLSkoA2jZQge7BJhluS7JmChEeD/ G/piRMCXceKalal0seYv/EWBoaxmZVQ== X-Google-Smtp-Source: AGHT+IGEdI/m4svppfmPS2gSY0SYEPYNYp3oSfTfXaLG6cc9P9XEpwUmwz6RrcAmeASBOk5SGH8XUHeRF/AeB3KWmWM= X-Received: by 2002:a05:690c:d83:b0:64b:2f31:296b with SMTP id 00721157ae682-6d40dd70dd8mr206567767b3.4.1725463868988; Wed, 04 Sep 2024 08:31:08 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 4 Sep 2024 18:30:39 +0300 Message-ID: Subject: Re: [PHP-DEV] Local constants To: HwapX Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000fbe78006214cdc08" From: zsidelnik@gmail.com (Eugene Sidelnyk) --000000000000fbe78006214cdc08 Content-Type: text/plain; charset="UTF-8" > Hello internals! > > I was wondering, has there been any discussion about supporting local > constants (variables that cannot be reassigned, perhaps even function > parameters)? > As for me, I would've hoped that there were local constants in PHP and I'd want to provide some thoughts on this regard. In my opinion, I'd really love the following syntax: a = 'the constant value'; I'm not sure if this would relate to the rest of PHP ecosystem, since there are already `const`/`define` keywords for ordinary constants and `readonly` for properties. Nonetheless, in my opinion, more concice syntax like `a = '...';` would promote usage of local constants instead of variables, which is generally better, being more stricter, though being a huge change to PHP as well. Best regards, Yevhen --000000000000fbe78006214cdc08 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hello internals!

I was wondering, has there been any discussion about supp= orting local constants (variables that cannot be reassigned, perhaps even f= unction parameters)?

As for me, I wou= ld've hoped that there were local constants in PHP and I'd want to = provide some thoughts on this regard.

In my=C2=A0opinion, I'd really love the following syntax:=

a =3D 'the constant= value';

I'm not= sure if this would relate to the rest of PHP ecosystem, since there are al= ready `const`/`define` keywords for ordinary constants and `readonly` for p= roperties.

Nonetheless, = in my opinion,
more concice syntax like `a =3D '= ...';` would promote usage of local constants instead of variables, whi= ch is generally better, being more stricter, though being a huge change to = PHP as well.

Best regard= s, Yevhen=C2=A0

--000000000000fbe78006214cdc08--