Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

which php called the present php?

Status
Not open for further replies.

stfaprc

Programmer
Feb 10, 2005
216
US
Would someone point me to the thread which details how to tell which function called a subfunction from with the subfunction?
 
oh gawd. not sure i know what you mean!

you can get a backtrace. From php5 you can use debug_print_backtrace(). if you couple this with an error handling routine, you get quite a powerful debugger. for older versions of php, you can use debug_backtrace() and parse the information yourself.
 
I have a library userdefined function and it would be nice to know which program/script called the userdefined function so that I could trace which program/script is sending in incorrectly formatted requests that cause warning messages but not error messages.
 
debug_print_backtrace(); did not seem to do anything.

var_dump(debug_backtrace());
did return an array, is there a way to have it print to a file and not the browser?
 
debug_backtrace() returns an array. You can do whatever you want with it. There are examples at the link I posted previously.

-----------------------------------------
I cannot be bought. Find leasing information at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top