Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68913 invoked by uid 1010); 12 Mar 2005 11:25:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68898 invoked from network); 12 Mar 2005 11:25:43 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 12 Mar 2005 11:25:43 -0000 X-Host-Fingerprint: 81.169.182.136 h59705.serverkompetenz.net Linux 2.4/2.6 Received: from ([81.169.182.136:44502] helo=strato.aixcept.de) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 11/37-31540-6B1D2324 for ; Sat, 12 Mar 2005 06:25:42 -0500 Received: from [192.168.1.3] (dsl-082-083-254-036.arcor-ip.net [82.83.254.36]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id EB6DE35C1D5; Sat, 12 Mar 2005 12:29:11 +0100 (CET) Date: Sat, 12 Mar 2005 12:25:41 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <17096947.20050312122541@marcus-boerger.de> To: Phillip Whelan Cc: internals@lists.php.net In-Reply-To: <20050312003526.45466.qmail@lists.php.net> References: <20050312003526.45466.qmail@lists.php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] php_embed and call_user_function From: mail@marcus-boerger.de (Marcus Boerger) Hello Phillip, Saturday, March 12, 2005, 1:35:26 AM, you wrote: > Im trying to call call_user_function() from inside php_embed. > It always returns FAILURE... > Here is the .c file I am trying to use > (minus the header files, for clarity...) > int main(int argc, char **argv) > { > zval *func; > zval *zret; > void ***trsm_ls; > > > if ( php_embed_init(1, argv PTSRMLS_CC) == FAILURE) { > puts("Failed to load"); > return; > } > MAKE_STD_ZVAL(func); > MAKE_STD_ZVAL(zret); > > zend_eval_string("include('test.php');", NULL, "TEST"); > > func->type = IS_STRING; > func->value.str.len = 4; > func->value.str.val = "test"; > > call_user_function(CG(function_table),NULL,func,zret,0,NULL TSRMLS_CC); This should be EG(function_table) instead. > > php_embed_shutdown(TSRMLS_C); > } regards marcus