You are here: Re: Retrieving the callee name « PHP Language « IT news, forums, messages
Re: Retrieving the callee name

Posted by Oli Filth on 10/03/12 11:31

Arnold McDonald said the following on 07/11/2005 15:51:
> Hi.
>
> My question is simple.
>
> Say there is a function called a(). It calls a function named b(). Inside
> b() I wanna know the name of the callee, that is a(). How to do that? Sure I
> can send the name of a() as a parameter, but is tehre any way to know the
> callee name, source, parent, etc?

(BTW, you mean "caller". "Callee" is the thing that gets called.)

It's basically not possible.

There are some convoluted methods that people have come up with that
involve dynamically re-parsing the whole script file and deducing where
it must have been called from, but that's just stupid. Anyway, who's to
say that the function call was from inside another function?

Why would you want to know where a function's being called from, anyway?


--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация