Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25193 invoked from network); 26 Apr 2008 18:45:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2008 18:45:44 -0000 X-Host-Fingerprint: 24.228.80.153 ool-18e45099.dyn.optonline.net Received: from [24.228.80.153] ([24.228.80.153:7190] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/12-11391-65873184 for ; Sat, 26 Apr 2008 14:45:43 -0400 To: internals@lists.php.net Message-ID: <48137859.1090004@thewritingpot.com> Date: Sat, 26 Apr 2008 14:45:45 -0400 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104 MIME-Version: 1.0 CC: dhiru.pandey@sun.com References: <19.A1.11391.C0373184@pb1.pair.com> In-Reply-To: <19.A1.11391.C0373184@pb1.pair.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Posted-By: 24.228.80.153 Subject: Re: Help with calling PHP functions From: edwardzyang@thewritingpot.com ("Edward Z. Yang") Dhiru Pandey wrote: > I am trying to figure out a way to invoke PHP functions directly i.e. > bypassing the PHP compiler (scanner and parser). For now it would be > great if I can get some help calling them from C. Ultimately I would > like to call them from Java. It's not difficult to call PHP_FUNCTIONs if you're inside PHP: you create a zval with the appropriate callback value (a string if you're dealing with global PHP functions) and then use call_user_function. You can find detailed instructions here: http://www.php.net/~wez/extending-php.pdf Can't help you for the other, although "Extending and Embedding PHP" by Sara Golemon, George Schlossnagle and Wez Furlong covers that topic, I think. -- Edward Z. Yang GnuPG: 0x869C48DA HTML Purifier Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]