Re: [PHP4BETA] Finding out function name
| From: | Faisal Nasim | Date: | Fri, 10 Mar 2000 17:08:20 +0000 |
| Subject: | Re: [PHP4BETA] Finding out function name | ||
| References: | 1 2 3 4 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11878@lists.php.net to get a copy of this message | ||
> > > > is it possible for a C function in an extension to find out under
> > > > which name it had been called from the php code ?
> > > >
> > > > (something similar to argv[0] in C programs)
> > >
> > > get_active_function_name().
> >
> > The question is not to find the function name, but
> > actually the file name the flex is parsing!
>
> Excuse me, I think I read the question carefully, and I presented the
> correct answer to what the question was asking.
get_active_function_name()
As it didn't work on my local copy, so I assume
it tells you the current function name you are in...
right? (example: function blah () { print
get_active_function_name(); } // blah)
The subject says so - okay! But, it seems he wants
the argv[0] (as in C), which is actually the file
name...
Or perhaps I am missing something?
<cut>
> > P.S. get_active_function_name() doesn't work on
> > PHP4b4pl1
>
> Of course, it does.
Weird!
<b>Fatal error</b>: Call to undefined function:
get_active_function_name() in
<b>x.php</b> on line <b>7</b><br>
I am trying it on Windows right now.
P.S. Does it make sense to include the platform in -v?
example:
$ php -v
4.0b4pl1-win32
Faisal