Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37029 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20490 invoked from network); 15 Apr 2008 18:04:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2008 18:04:55 -0000 Authentication-Results: pb1.pair.com header.from=magreenblatt@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=magreenblatt@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.170.189 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: magreenblatt@gmail.com X-Host-Fingerprint: 64.233.170.189 rn-out-0910.google.com Received: from [64.233.170.189] ([64.233.170.189:37303] helo=rn-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/6B-62008-74EE4084 for ; Tue, 15 Apr 2008 14:04:55 -0400 Received: by rn-out-0910.google.com with SMTP id i24so1150291rng.0 for ; Tue, 15 Apr 2008 11:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=wIE99DvSM9rs5fQZc7e5dAS1X6Q9kBpGwvN/9ZM9ZWM=; b=iZffH5SxyMbRVftkgBdxGKss6vlVF8eLje4bCOMXVAkIcV3QBwXGFnf35PZ/w3HzbyQl8irDNwEJbbWMxQ3/tAVDkQ+xC/JKB+6umRH9fxW5yUSm2OlEfwBHZJUM5QxN6qeKDpop/98X6EouzJCe33K1dvH5nAq0tuGAztx6P+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=g0dFBmWz7/LyzI/ayNiLYxPoVy2hbB0X59SuLrDa1C7Zb5yzjMC4MWQkzG3peL4antCfLUYXE0t9qxh/u1YusdSs4wbet7tiingpa/CypUlhA672fXYEnIG3TZMR+TI1QVeSuFRWABYNdFTPd5lirnoaxRpT9Z2e0BzkpP3LUQ8= Received: by 10.114.136.1 with SMTP id j1mr5338397wad.152.1208282691939; Tue, 15 Apr 2008 11:04:51 -0700 (PDT) Received: by 10.114.149.15 with HTTP; Tue, 15 Apr 2008 11:04:51 -0700 (PDT) Message-ID: Date: Tue, 15 Apr 2008 14:04:51 -0400 To: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_31001_7132226.1208282691935" References: Subject: Re: calling a script function via call_user_function From: magreenblatt@gmail.com ("Marshall Greenblatt") ------=_Part_31001_7132226.1208282691935 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi All, A correction to my earlier email. On Tue, Apr 15, 2008 at 11:37 AM, Marshall Greenblatt < magreenblatt@gmail.com> wrote: > > Approach B: > > Execute a PHP script and retrieve the return value without calling a > particular PHP function. > > On the PHP side: > > return strtoupper( $GLOBAL_VARIABLE ); > > On the application side: > > php_register_variable("GLOBAL_VARIABLE", "the string to make uppercase", > NULL TSRMLS_CC); > > zval *retval; > php_execute_simple_script(&file_handle, &retval TSRMLS_CC); > > My problem with Approach B is that the return zval from the > php_execute_simple_script() function always contains a true/false value > instead of whatever was returned using the 'return' construct from the code. > > This approach does actually work as advertised. I had a bug in my test code :-). However, that still leaves the original question -- how to call a function defined in a PHP script using call_user_function() or similar? Thanks, Marshall ------=_Part_31001_7132226.1208282691935--