When to use PHP's variable variables?

200 views Asked by At

I've been using PHP for some basics Back-End development for a while now. I saw something about interpretations of variables while I was looking for some changes which came with PHP 7. I'm not using them and it would be great if someone can explain why to use them?

What I mean is: enter image description here

What are the pros of using them?

1

There are 1 answers

1
Jirka Hrazdil On BEST ANSWER

You use variable interpretation in situations when you need to dynamically reference a variable and don't want to use an array. Generally I would not recommend using it, as you lose benefits such as static code analysis.