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



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to