3

How to disable object providing with debug_backtrace in PHP 5.2.11? debug_backtrace(false) didn't work.

Thanks in advance,

Simon

Jon
  • 428,835
  • 81
  • 738
  • 806
Simon
  • 594
  • 2
  • 6
  • 25

2 Answers2

4

It's quite late, but I would like to answer this. Actually this is not my answer, but I was also looking for solution for the same above mentioned problem and I found answer here on official site of PHP : debug_backtrace

Here, robert has gave brief description on using various options in debug_backtrace function.

debug_backtrace() - show all options
debug_backtrace(0) - exlude ["object"]
debug_backtrace(1) - same as debug_backtrace()
debug_backtrace(2) - exlude ["object"] AND ["args"]

I hope, this will help others.

Tony Montana
  • 921
  • 18
  • 46
  • This is probably not going to help in this specific case though, as OP was asking for a solution that would work in PHP 5.2.11. Those options above will work for PHP 5.3.6 or newer only. – jeherve Feb 21 '19 at 15:31
0

The PHP 5.2.11 source indicates that debug_backtrace accepts a boolean parameter, so passing in false should work.

Jon
  • 428,835
  • 81
  • 738
  • 806
  • print_r(debug_backtrace(false)) still outputs an array with file, line, function, class, type, object, args and object is still filled :/ – Simon Sep 03 '12 at 11:01