1 <?php
2 $zongzi = "adfasdf";
3 //将$zongzi作为数组的key,adfasdf作为数组的值返回
4 $val = (get_defined_vars());
5 echo $val['zongzi'];
6
7
8 function zongzi(){
9 echo "adfads";
10 }
11
12 $function = get_defined_functions();
13 //将自定义的函数获取,函数名作为数组的key,函数返回的结果作为值,再扔给了user
14 var_dump($function['user']);
15 echo $function['user']['zongzi'];
16 ?>