<?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 查看所有已载入文件和所有变量
最新推荐文章于 2023-01-09 16:21:44 发布