memory.bonds

PHP




Last update:   29-05-2021

Naming constraints

It is possible to create variables whose names do not follow the constraints. Variable variables are a very powerful tool, and should be used with extreme care. Their improper use can lead to some significant security issues.
 RunCode
$name = '123';

$$name = '456';

echo ${'123'}; // output 456
A technique similar to variable variables can also be used to hold function names:
 RunCode
function myFunc() {
    echo 'myFunc!';
}

$f = 'myFunc';

$f();  // output myFunc!
... 2 more rows

Questions    

        A B C D E F
🔔
1/3