Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117307 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55401 invoked from network); 12 Mar 2022 09:20:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Mar 2022 09:20:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B2CBA1804F8 for ; Sat, 12 Mar 2022 02:44:32 -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,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: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 ; Sat, 12 Mar 2022 02:44:32 -0800 (PST) Received: by mail-io1-f48.google.com with SMTP id 195so12935999iou.0 for ; Sat, 12 Mar 2022 02:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DUZmGeS2j4HHsQ7+MV30TBYPl1nKQ7mAipfa7byYfNc=; b=LbzB53L0Y9mYdYKRLSeMC6DcsXC1e5grKRM4ahdbK+vXTmbpmKuRtQPaavpNiZSKqH +q9sxgVldp/8VgLEzAn1EbLX8yqQu/E/YQuZp5o2A9VtAb9l8uF2RHhWTpJi6966ob9/ O/miWxXiAkRXcwI3gDKkeT5IH/Z3yE2ES45jHTDTa6LiHm4t4GmigD/h5gFif0e1pT3b ZObqkqBSlrOkEu452yhmJXCMDSS0yVVlBA7SrEmF7WxJYzc3fzPYZaDGieEnySeiMA4H nBK/K9KRa6WWoznXasTkfc0ifYG94ApC8IldoTJnK/Xp1Yx0G7bceP2d6QMiItvnYTSv FS4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DUZmGeS2j4HHsQ7+MV30TBYPl1nKQ7mAipfa7byYfNc=; b=3XNaAPgkTVfHJri+Vj/ABVH7YUtcxr40VY/ryjj1ebGXgFWJUdH+DjPaCc1rs9jCyH sNtFxSbJhqEr5JpCNumOyfvVFT0/bwBTCwGxvH/r8uNoD5uOXabKGjTrtxpoLRY3jBpj XUk+MKe37dV1KBwibTaHS+4SiUx+z7POpTf2hAHozC8ueTaFk0LRV0/OfPz0POQXFXib 1w8m5TLtHHnWmCVstpPtPUwDFUMRhZ+YEnLQ8/2pDJyexqujL7OxxA/zntYNPEuxKaOx mSM1ujgfQozuQicNXmM4YFmNsTt0ZB3I+7dLyA5amSoift3QPpaE639/Yed+acHox4FM W21g== X-Gm-Message-State: AOAM533W7Lz9lohDKYfNaGDlS7o49gCHU6gpKUwu90Uku2a2d+axjSD3 d6xSpLA/Usk2xV0CCR8DyvjplbGbIeEJhk13ON16FfIvVqg= X-Google-Smtp-Source: ABdhPJwdehx+BXPU7YWUkPbPbw7MyqWYGzUOYm6lDmW6X0YTHLTLGa1HQtsoTKLl9l0chC2e24BQCNCwtqQgQnMThE8= X-Received: by 2002:a02:6a5e:0:b0:317:cb94:d0f7 with SMTP id m30-20020a026a5e000000b00317cb94d0f7mr11930326jaf.11.1647081871794; Sat, 12 Mar 2022 02:44:31 -0800 (PST) MIME-Version: 1.0 References: <20220312031138.5e0669a4@platypus> In-Reply-To: <20220312031138.5e0669a4@platypus> Date: Sat, 12 Mar 2022 11:44:05 +0100 Message-ID: To: BohwaZ Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000e264cd05da032152" Subject: Re: [PHP-DEV] [RFC][Under discussion] Deprecate ${} string interpolation From: kjarli@gmail.com (Lynn) --000000000000e264cd05da032152 Content-Type: text/plain; charset="UTF-8" On Sat, Mar 12, 2022 at 3:11 AM BohwaZ wrote: > This RFC is confusing two different things: > > 1. variables inside strings (options 1, 2, 3) > 2. dynamic variables names (option 4) > > The 4th one is very useful. > > $v = ${'param_' . $name}; > Please don't ever ever ever write code like that! > There is no other practical way to do that, so removing that feature > would mean breaking something useful with no replacement. > While it's still a problematic way of writing code, you can use arrays instead: `$v = $something['param_' . $name] ?? null; This at least keeps all the issues to the scope of `$something`. > Also why break something that works and is used? > Variable variables should be removed from PHP asap. It's 2022 and I still encounter bugs due to this "working" in legacy applications. --000000000000e264cd05da032152--