php 查看全部已载入文件和全部变量

<?php
echo '<pre>';
 //查看运行到打印行的全部载入文件

$debug_included_files = get_included_files();
echo "<br/><br/>included_files=<br/>";
print_r($debug_included_files);


//查看系统里的全部变量
echo "<br/><br/>globals=<br/>";
print_r($globals);	

// $GLOBALS --- 保存全部全局变量(只在当前页面中的) 
//get_defined_vars() --- 返回由全部已定义变量所组成的数组(包括全局变量,超全局变量等)  这个比较经常使用,输出的比较详细
//get_defined_constants() --- 返回由全部已定义常量所组成的数组 
echo "<br/><br/>get_defined_vars=<br/>";
$debug_get_defined_vars = get_defined_vars();
print_r($debug_get_defined_vars);	

echo "<br/><br/>get_defined_constants=<br/>";
$debug_get_defined_constants = get_defined_constants();
print_r($debug_get_defined_constants);	

// get_defined_functions (PHP 4 >= 4.0.4, PHP 5) — 获取全部已经定义的函数
echo "<br/><br/>get_defined_functions=<br/>";
$debug_get_defined_functions = get_defined_functions();
print_r($debug_get_defined_functions);

//get_loaded_extensions (PHP 4, PHP 5) — 获取全部可用的模块
echo "<br/><br/>get_loaded_extensions=<br/>";
print_r(get_loaded_extensions());

// get_extension_funcs (PHP 4, PHP 5) — 获取指定模块的可用函数
echo "<br/><br/>get_extension_funcs=<br/>";
print_r(get_extension_funcs("gd"));
print_r(get_extension_funcs("xml"));

//get_defined_constants (PHP 4 >= 4.1.0, PHP 5) —  获取关联数组的名字全部的常量和他们的价值\n
echo "<br/><br/>get_defined_constants=<br/>";
print_r(get_defined_constants(true));

//get_declared_classes (PHP 4, PHP 5) —  获取由已定义类的名字所组成的数组
echo "<br/><br/>get_declared_classes=<br/>";
print_r(get_declared_classes());
?>

参考  PHP输出当前进程全部变量/常量/模块/函数/类的示例php

http://www.jb51.net/article/42890.htm数组

相关文章
相关标签/搜索