Reply to Re: Retrieving the callee name

Your name:

Reply:


Posted by Oli Filth on 10/28/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

[Back to original 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

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