# zend_call_function() and co.

- Thread: https://externals.io/message/54254
- Original archive: https://news-web.php.net/php.internals/54254
- Started by Flavius Aspra on 2011-07-29T18:03:13+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #54254 — Flavius Aspra — 2011-07-29T18:03:13+00:00

URL: https://externals.io/message/54254#54254

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

What is symbol_table for? Maybe to put in the function's context other 
variables beside the parameters, like $this?

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?


Regards,
Flavius

---

## #54256 — johannes@schlueters.de — 2011-07-29T23:01:49+00:00

URL: https://externals.io/message/54254#54256 · In reply to: #54254

> 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
