Posted By

adampatterson on 05/07/10


Tagged

back trace


Versions (?)

Backtrace


 / Published in: PHP
 

URL: http://uk.php.net/debug_print_backtrace

  1. $a = 0;
  2.  
  3. function iterate() {
  4. global $a;
  5. if( $a < 10 )
  6. recur();
  7. echo $a . ", ";
  8. }
  9.  
  10. function recur() {
  11. global $a;
  12. $a++;
  13.  
  14. // how did I get here?
  15. echo "\n\n\n";
  16. debug_print_backtrace();
  17.  
  18. if( $a < 10 )
  19. iterate();
  20.  
  21. }
  22.  
  23. iterate();

Report this snippet  

You need to login to post a comment.