PHP 用Symfony VarDumper Component 调试
Symfony VarDumper 类似 php var_dump()
官方文档写的安装方法 :
按照步骤 就可以在 running any PHP code 时候使用了
In order to have the dump()
function always available when running any PHP code, you can install it globally on your computer:
- Run
composer global require symfony/var-dumper
;//全局安装 - Add
auto_prepend_file = ${HOME}/.composer/vendor/autoload.php
to yourphp.ini
file; //在php.ini里面配置auto_prepend_file 后面是全局安装的composer autoload.php文件的路径位置信息 - From time to time, run
composer global update symfony/var-dumper
to have the latest bug fixes.//全局更 - 这样在任意文件内就可以使用dump 来打印调试了