I have this variable in a big php script that I want to trace back to where/when and what value it was instantiated. Is there a function/api or debugging techniques to do this?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You can use debug_print_backtrace() function. http://php.net/manual/en/function.debug-print-backtrace.php
Output:
If you're using PHPStorm you can set breakpoints and inspect the values of variables.
http://blog.jetbrains.com/phpstorm/2013/12/just-in-time-debugging-and-php-exception-breakpoints-with-phpstorm-and-xdebug/
You'll need xdebug installed as well.