Knowing the name of a "parent" function.

This is a discussion on Knowing the name of a "parent" function. within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hey all I'm relatively new to PHP (arnt we all at some point eh?), but I'm having trouble ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2004
Andy Jenkins
 
Posts: n/a
Default Knowing the name of a "parent" function.

Hey all I'm relatively new to PHP (arnt we all at some point eh?), but
I'm having trouble trying to establish if its possible to get the name
of a function that called another function. Confused ? Let me try
this ...

function funca () {

blah blah
blah blah

foobar ("a string");
}

function foobar ($string) {

print "Function foobar, called by function " ?????? );

}

Its the ?????? that I'm stuck on. I want the ???? to transpose to
"funca" if possible.

Any ideas ?

Thanks in advance for any assistance you can give.
--
Andy Jenkins
UK Broadband Usergroup : http://www.uk-bug.net
Reply With Quote
  #2 (permalink)  
Old 02-28-2004
John Smith
 
Posts: n/a
Default Re: Knowing the name of a "parent" function.

"Andy Jenkins" <andy_nfTORIES@btopenworld..com> schreef in bericht
news:jrm140hcsg2o3j3ilou67g11ng1notj6u2@4ax.com...
> Hey all I'm relatively new to PHP (arnt we all at some point eh?), but
> I'm having trouble trying to establish if its possible to get the name
> of a function that called another function. Confused ? Let me try
> this ...
>
> function funca () {
>
> blah blah
> blah blah
>
> foobar ("a string");
> }
>
> function foobar ($string) {
>
> print "Function foobar, called by function " ?????? );
>
> }
>
> Its the ?????? that I'm stuck on. I want the ???? to transpose to
> "funca" if possible.
>
> Any ideas ?
>
> Thanks in advance for any assistance you can give.
> --
> Andy Jenkins
> UK Broadband Usergroup : http://www.uk-bug.net


Use objects!


Reply With Quote
  #3 (permalink)  
Old 02-28-2004
Andy Hassall
 
Posts: n/a
Default Re: Knowing the name of a "parent" function.

On Sat, 28 Feb 2004 18:22:15 +0000, Andy Jenkins
<andy_nfTORIES@btopenworld..com> wrote:

>Hey all I'm relatively new to PHP (arnt we all at some point eh?), but
>I'm having trouble trying to establish if its possible to get the name
>of a function that called another function.


http://uk2.php.net/debug_backtrace

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0