感觉这个东西没什么多大作用,只会降低程序的可读性
<?php
class Test{
var $a='4nail';
}
$test=new Test();
$b='a';
echo $test->$b;//output:4nail
echo '<br />';
$arr=array('sdfsd','test');
$arr2='arr';
$r='snail';
echo ${$arr2}[1];//output:test,最好用{}区分歧义
echo $$arr2[1];//output:snail
echo ${$arr2[1]};//output:snail,和上面一样
echo '<br />';
$m='hello';
$hello='world';
echo "$m ${$m}";//output:hello world
?>