Re: calling a script function via call_user_function

From: Date: Tue, 15 Apr 2008 18:04:51 +0000
Subject: Re: calling a script function via call_user_function
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-37029@lists.php.net to get a copy of this message
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

« previous php.internals (#37029) next »