# Interpolation

- Thread: https://externals.io/message/111931
- Original archive: https://news-web.php.net/php.internals/111931
- Started by qu3s710n on 2020-09-24T18:59:38+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #111931 — qu3s710n — 2020-09-24T18:59:38+00:00

URL: https://externals.io/message/111931#111931

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";
```

---

## #111932 — Rowan Tommins — 2020-09-24T19:38:01+00:00

URL: https://externals.io/message/111931#111932 · In reply to: #111931

> 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]
