Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119017 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79135 invoked from network); 17 Nov 2022 20:21:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Nov 2022 20:21:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1D7B91804A9 for ; Thu, 17 Nov 2022 12:21:16 -0800 (PST) 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, 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-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 ; Thu, 17 Nov 2022 12:21:15 -0800 (PST) Received: by mail-pg1-f171.google.com with SMTP id 136so3080279pga.1 for ; Thu, 17 Nov 2022 12:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NOxYizDHfNgDgXORmBHWk681gDsGE1xx4Of7aMiBOgs=; b=TfTSckM0NC6pxFD1eoKXgRclZp7nngX+NpYrDoOCa3Dsc0P8bUxJ4AX9Ty0nsPCzkx nNH9LlwKMjTJnwstompNTfBFaR+Y5EvGTtXgtV2DGyNkleaH+YII9oyBrRxqfomUxNel VNItuS7bgeqpbNZY3hl3DpjSiEZVcTj13a422w7hgVFYfcWqh0WrH1Q+8juNrVd6JXb4 0SPlfbESag+aWHiGI0nofEeXN/+AENCvCP8wCDSO5qOLqhd42eYgX3plbuX+BruqAL+h yWK3JqTWbOaKv8l7FFmM3sZVoGgRJn/tNNW4fpJp2legXSt36K92P7TIRgqT2DPS01EV aqzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=NOxYizDHfNgDgXORmBHWk681gDsGE1xx4Of7aMiBOgs=; b=fgcKWCYUK0NbIEege1Uy3EHZxlzAVh7QERypIJ8GWYplK4dVj6m8WDz5RkhfH1QanC JpZ2rkhSpaKCuCzlqENPpFnJ5DEVhTgebc0x9ZzVfIdMB5TuWxjR3Xe8o0JZYVEAjYmY 1Z3svrI1KNnjfba8Q3gYcFfSNUNYRXRwJUfnWrC7v+FarZkwKWbcrNQ9CBQ2oXMtq0My qs98hsv99fMIX7ZRuWSMekNYzeDClek7gBpH2B8CGXDxwn7RJxayZY5g8NFD9qPfJv+M 2WSEmx97PhT4/FZ1ehQ7MWa/ybpOnKqRabwci3hE55jgFgcdeZQ772VZX1U5bCywnDQD ha9A== X-Gm-Message-State: ANoB5pkVdq6clqFgDOdY3U9Nz7WkTx54mWpWVRWcNhE/6n7hJSiTh+PJ sxH0hRiBvzo/NwLv2pjIRBOIZ/5Neqqn1iKgrijmdmcjsaY= X-Google-Smtp-Source: AA0mqf733GrhOWx5aL/hOZCuDu4RqwzHmFSDy6snB8GXcO6K/URKyrf3WrM9UUXdvd7sutltRP8beeasVf2U2kPtJzo= X-Received: by 2002:a63:fa44:0:b0:476:d169:30ea with SMTP id g4-20020a63fa44000000b00476d16930eamr3558054pgk.474.1668716473874; Thu, 17 Nov 2022 12:21:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 17 Nov 2022 21:21:02 +0100 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC][Dynamic class constant fetch] From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi everyone Sorry for the late reply. I won't waste too many lines on usefulness as it is highly subjective. The change will seem worth it to some people and not to others. IMO language consistency is important and mainly what I'm striving for. --- Hi Micha=C5=82 > Can it be extended to non class constants and additionally deprecations p= lan for constant() function? I'm not sure what that syntax would look like. {$foo} is not a viable option since it is ambiguous or rather would require arbitrary lookahead (i.e. {$foo;} is valid syntax today). A different syntax would be possible but inconsistent with the existing options. In any case, this would likely require its own RFC and should be discussed separately. --- Hi Nikita > See https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-a= nd-memory-safety for why the order of execution is the way it is. As class = constants do not support writes, these concerns do not apply, and the "norm= al" order can be used (as you propose). Thank you! I remembered discussing this back when implementing the nullsafe operator but was fuzzy on the details :) This makes more sense to me now. I tried to clarify in the RFC. Ilija