Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Feb 20, 2005, 15:20   #1
Itshim
SitePoint Addict
 
Join Date: Oct 2004
Location: Southwest US
Posts: 211
Determining what called a function

Ok, I know this is a bazaar question, but say I have two functions, and the first function calls the second function. Is there a way to determine what called the second function?

Such as:
Code:
function One() {
      Two();
}

function Two() {
     //Determine what called this function
}
I have a function which catches certain errors, and I was wondering if I can dynamically determine where the error function was called.

Thanks for any help,
Itshim
Itshim is offline   Reply With Quote
Old Feb 20, 2005, 15:24   #2
lilleman
Tranceoholic
 
lilleman's Avatar
 
Join Date: Feb 2004
Location: Örebro, Sweden
Posts: 2,718
Hi,

I'm not sure, but you might be able to do it using debug_backtrace.
lilleman is offline   Reply With Quote
Old Feb 20, 2005, 15:30   #3
Itshim
SitePoint Addict
 
Join Date: Oct 2004
Location: Southwest US
Posts: 211
Thank you, I believe that is exactly what I'm looking for. Leave it to PHP to have what you need.

Thanks again,
Itshim
Itshim is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 18:49.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved