Re: zend_call_function() and co.
| From: | Johannes Schlüter | Date: | Fri, 29 Jul 2011 23:01:49 +0000 |
| Subject: | Re: zend_call_function() and co. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54256@lists.php.net to get a copy of this message | ||
On Fri, 2011-07-29 at 20:03 +0200, Flavius Aspra wrote:
> Hi
>
> I have a few questions about zend_fcall_info and zend_fcall_info_cache.
>
> Regarding zend_fcall_info
>
> What is function_name useful for? I have a feeling it's for error
> reporting, but I'm not sure
The engine hast to know what to call.
> What is symbol_table for? Maybe to put in the function's context other
> variables beside the parameters, like $this?
The symbol table is the table of the mathods available. The context is
needed to call private elements or the correct method in case you have
overwritten methods. (class A { function m()[}} class B extends A
{ function m()[}} ... sometimes you want to call B::m(), sometimes, you
want to call A::m() - especially as in parent::m() from within B::m())
The object instance identifies the current instance.
The object instance is needed to access the correct proeprties. For
calling a global function these can be NULL.
> What is zend_fcall_info_cache for? I've seen in some places that
> zend_call_function() sometimes takes a NULL for it. When is it useful to
> cache information about the function call?
One thing the function does is a function lookup, if you call the
function multiple times it is nice to keep the pointer to the actual
function around and save the subsequent lookups.
johannes