Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debug_print_backtrace doesn't work

I have PHP 5.3.4 and when I try to use debug_print_backtrace, I don't get anything. When I use vardump, I get an empty array, as you can see below.

index.php:

<?php
define('WP_USE_THEMES', true);

require('./wp-blog-header.php');

var_dump(debug_backtrace());

echo PHP_VERSION;
?>

which returns

...
</html> 
array(0) {
}
5.3.4

Can anyone tell me what is wrong? I am expecting to see everything that was called in the run. Instead I don't see anything.

like image 203
Arlen Beiler Avatar asked Jan 27 '26 20:01

Arlen Beiler


1 Answers

debug_backtrace() doesn't show you what has been called so far but the current call stack (i.e. more or less where php would jump to on a return statement until it reaches the top level) when the function is invoked.
You might be interested in a profiler like e.g. the one implemented in XDebug plus something to analyse the data like e.g. kcachegrind.

like image 141
VolkerK Avatar answered Jan 29 '26 08:01

VolkerK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!