Re: help with duplicate flag in string functions
| From: | fab wash | Date: | Thu, 25 Jul 2002 21:12:06 +0000 |
| Subject: | Re: help with duplicate flag in string functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86202@lists.php.net to get a copy of this message | ||
Hi,
you want to duplicate if you don't want the called procedure to touch the
original variable, or if you declare it as a local in your procedure and
don't pass it as a pointer.
Fab.
----- Original Message -----
From: "Tony Leake" <tony@webwise-data.co.uk>
To: <php-dev@lists.php.net>
Sent: Thursday, July 25, 2002 2:05 PM
Subject: [PHP-DEV] help with duplicate flag in string functions
> Hi,
>
> I'm just starting out writing modules by reading api docs on zend.com
> and reading source code of existing modules.
>
> Several functions (example:)
> add_next_index_string(zval *array, char *str, int duplicate)
>
> have the int duplicate flag, the docs say, The flag duplicate specifies
> whether the string contents have to be copied to Zend internal memory.
>
> but how do I know if the string should be copied to memory, in the
> simple functions I'm writing it seams to make no difference whether I
> set this to 1 or 0 but it must do something?
>
> Thanks for your time
> Tony
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>