- var_dump: documentation ( source)
<?php
// Variable variable.
$a = 'b';
$b = 'target';
var_dump($$a == $b);
// Anon function with inclusion of scope.
$fn = function($c) {
var_dump($$c == 'target');
};
$fn($a);
// I can use scope within using variable variable.
$fn = fn($c) => $$c == 'target';
var_dump($fn($a));
// I can't return it though.
$fn = fn($c) => $$c;
var_dump($fn($a));