Re: Interpolation

From: Date: Thu, 24 Sep 2020 19:38:01 +0000
Subject: Re: Interpolation
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-111932@lists.php.net to get a copy of this message
On 24/09/2020 19:59, qu3s710n wrote:
Wouldn't you like to have adequate interpolation in php?
$index = 12345;
const SOMETHING = 333;

function number() {
     return 888;
}
echo "this is a ${{ number() + 123 * $index + SOMETHING }} string";
Personally, I find the interpolation we have "adequate", but you're not alone in thinking that a more powerful feature would be nice. Have a look at this recent thread for some of the possibilities and problems: https://externals.io/message/111519 As a general note, though, it's best to broach new topics with a bit more thought than this - being able to say "I've looked into improving X, and it seems possible that it could work like Y, with possible problem Z; should I pursue the idea?" is going to get a more favourable reaction than just "wouldn't you like X?". Regards, -- Rowan Tommins (né Collins) [IMSoP]

« previous php.internals (#111932) next »