Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19880 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59945 invoked by uid 1010); 1 Nov 2005 10:45:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59924 invoked from network); 1 Nov 2005 10:45:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2005 10:45:14 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:41705] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 5F/7D-02082-DD937634 for ; Tue, 01 Nov 2005 04:48:14 -0500 Received: from [192.168.1.3] (dslb-084-063-009-026.pools.arcor-ip.net [84.63.9.26]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 825F6610285; Tue, 1 Nov 2005 10:51:52 +0100 (CET) Date: Tue, 1 Nov 2005 10:48:10 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1468079790.20051101104810@marcus-boerger.de> To: Bob Silva Cc: internals@lists.php.net In-Reply-To: <002f01c5deb0$2a2e87b0$5d54edc6@jake> References: <002f01c5deb0$2a2e87b0$5d54edc6@jake> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Question on return_value From: helly@php.net (Marcus Boerger) 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