get_defined_vars即将(引用):
返回一个多维数组,其中包含所有定义变量的列表,无论是环境、服务器还是用户定义的变量。
好的,对于我的调试任务,我只需要那些用户定义的变量。有PHP内置或补充函数吗?
编辑:
<?php
/*
this script is included, and I don't have info
about how many scripts are 'above' and 'bellow' this*/
//I'm at line 133
$user_defined_vars = get_user_defined_vars();
//$user_defined_vars should now be array of names of user-defined variables
//what is the definition of get_user_defined_vars()?
?>
$GLOBALS
数组怎么样? - Bogdan Burym