Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56355 invoked from network); 29 Jul 2011 23:06:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2011 23:06:21 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:57914] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/C4-01298-BEC333E4 for ; Fri, 29 Jul 2011 19:06:20 -0400 Received: from [IPv6:::1] (config.schlueters.de [217.114.211.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id F1D8777C3A; Sat, 30 Jul 2011 01:06:15 +0200 (CEST) To: Flavius Aspra Cc: internals@lists.php.net In-Reply-To: <4E32F5E1.2080302@gmail.com> References: <4E32F5E1.2080302@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 29 Jul 2011 16:01:49 -0700 Message-ID: <1311980509.1490.7.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] zend_call_function() and co. From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) 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