Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115615 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89222 invoked from network); 1 Aug 2021 10:53:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Aug 2021 10:53:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EA6621804B0 for ; Sun, 1 Aug 2021 04:21:50 -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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 ; Sun, 1 Aug 2021 04:21:50 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id r23so20054462lji.3 for ; Sun, 01 Aug 2021 04:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=JuuCsE9dAeHC7JUvLKPZWl2F9morMP4I0UwiIuSOJvc=; b=sK9KW8bDhjzYXGobylhEDx99hadKzKje5k+x/idjvEq3WUhz+USJOUYJVh9EdxRrwP Mxqu28Eocqr4S1itLGA8GKzi4tZG3MrikusQcNHejQ95iCp58D6Q+zzR0JHwK8h4Vzud xW6IiTt/qyh1ihRd5x4Irs7n1A9jQLVNxxlcMxnkHgm4LlbLLERWx6LeBEIUyMReBXu2 /oILhS8elFcOyliVCDHQaEUKQB7S2gLw2CayuB8JOkyGN3izqk5utm9CKc5apsg4Y+lY 9Ly1ADWPwH7viVBg/9W2ELQ4GLXP5n8dyWy5BcIJwBaZzIEfDn7Y5cwlIUrIfnqbk4XQ gLCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=JuuCsE9dAeHC7JUvLKPZWl2F9morMP4I0UwiIuSOJvc=; b=gTVtwHR5AFh+bpRWJ3liu/9It/RAmFhd8r5bTpH2p/5oJQbQC1Sg8pWovWBW9/+bYf r0M+5611PjY4nIrKUco82sz04TjGUy7hqdyVL7ArrWCREJbUosO5xdv2hVruXraMGAt4 WYU4Mp1WMXM+Glerve1EG/FuQWYZgbk+mt+UW+RlEMK4F97Jz7FYQ1CFK2o+6GpX5tsD pF7LH2VnCvnCzwf+RqTerkr13iLVBtaH2sut/kHbAzYPb93osUyqU0wi2pFKqmq4bjax vcptIk2UU90UPUi9acn/JLXSqJ3R5iSjoO5mrxKlS93Yznh95+0r2YkO7V0tLBs9g/Od 0U3w== X-Gm-Message-State: AOAM532JTZg/svq3PLCGF1/ZSy/lsJfxtaH8pRRtTMvvxeoX+vfhVG8r xjn7MpPJGBW2g3WcsLpzrfgBAbqdwdDAdg== X-Google-Smtp-Source: ABdhPJzBc8FtlC5AK9SoZC4Mol51PcwE2nzn5B5aBWI4LprBpuiu6Uo7rgPYEIXv+lnqVH/LeRdzZg== X-Received: by 2002:a2e:a307:: with SMTP id l7mr8046679lje.318.1627816908977; Sun, 01 Aug 2021 04:21:48 -0700 (PDT) Received: from smtpclient.apple ([195.3.159.227]) by smtp.gmail.com with ESMTPSA id f13sm647722lfm.307.2021.08.01.04.21.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Aug 2021 04:21:48 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_CCEC0F75-EFF0-4B41-A4D2-9F0A113F8BA4" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Message-ID: <22EF92EC-C5A3-498E-9EFD-DE2B5B204BB7@gmail.com> Date: Sun, 1 Aug 2021 14:21:48 +0300 To: internals@lists.php.net X-Mailer: Apple Mail (2.3654.120.0.1.13) Subject: RFC: autoconst From: free.smilesrg@gmail.com (Serhii Smirnov) --Apple-Mail=_CCEC0F75-EFF0-4B41-A4D2-9F0A113F8BA4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello! This is my first RFC proposal. I have an idea about introducing = autoconst keyword. Motivation: reduce duplicated code (copy/pasting constant name as value) reducing potential typo errors in constant values instead of defining constants like: const FOO =3D 'FOO'; they could be defined like: autoconst FOO; // defines a constant FOO with the value 'FOO' Also, modifiers could be useful: autoconst uppercase foo; // defines a constant foo with value 'FOO' autoconst lowercase FOO; // defines a constant FOO with value 'foo'; and maybe: autoconst camelcase FOO_BAR; // defines a constant FOO_BAR with value = 'fooBar' autoconst snakecase fooBar; // defines a constant fooBar with value = 'foo_bar' could be listed like: autoconst FOO, BAR, BAZ; autoconst lowercase FOO, BAR, BAZ; What do you think about that? If you like my idea, I would request a = karma for creating this RFC in the wiki. Hope you'll like the idea!= --Apple-Mail=_CCEC0F75-EFF0-4B41-A4D2-9F0A113F8BA4--