Re: Question on return_value
| From: | Marcus Boerger | Date: | Tue, 01 Nov 2005 09:48:10 +0000 |
| Subject: | Re: Question on return_value | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19880@lists.php.net to get a copy of this message | ||
Hello Bob,
look at RETURN_ZVAL() again.
Tuesday, November 1, 2005, 7:47:45 AM, you wrote:
> Hi,
>
> I have an internal function defined that returns an array zval:
>
> zval *pow_zstring_internal_split(Z_STRVAL_P(ivalue), separator, count, 0
> TSRMLS_DC);
>
>
>
> When I call it like this, return_value is NULL in userland.
> return_value = pow_zstring_internal_split(Z_STRVAL_P(ivalue), separator,
> count, 0 TSRMLS_CC);
>
>
> But when I call it like this, it works as expected and an array is returned
> to userland
> array = pow_zstring_internal_split(Z_STRVAL_P(ivalue), separator, count, 0
> TSRMLS_CC);
> *return_value = *array;
>
>
> I'm sure there is an obvious answer, but given my background (or lack
> thereof) in C, I can't figure it out.
> How does the temporary assignment change things inside the engine?
>
> Bob
Best regards,
Marcus