Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76644 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33971 invoked from network); 18 Aug 2014 10:24:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2014 10:24:53 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:42793] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/70-31658-374D1F35 for ; Mon, 18 Aug 2014 06:24:52 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id EC1BD10F392; Mon, 18 Aug 2014 11:14:55 +0100 (BST) Date: Mon, 18 Aug 2014 11:14:55 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Wei Dai cc: Aaron Lewis , PHP Internals In-Reply-To: <86EEE03317124B84B62883DBE41C4ADD@gmail.com> Message-ID: References: <86EEE03317124B84B62883DBE41C4ADD@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: =?UTF-8?Q?Re=3A_=5BPHP-DEV=5D_=E5=9B=9E=E5=A4=8D=EF=BC=9A_=5BPHP-DEV=5D_How_should_I_call_a_PHP_function?= From: derick@php.net (Derick Rethans) On Mon, 18 Aug 2014, Wei Dai wrote: > > I'm trying to call a function inside a module, a PHP_FUNCTION. > > > > Other than zend_eval_stringl, what's the direct way to do it? > > Please refer to call_user_function and call_user_function_ex. Actually, you need to be careful with this. If you are calling another PHP function in the same extension, do *not* use call_user_function. Instead, create a common C function that you can call from whereever you need to. call_user_function(_ex) is not fast. cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine