>'duplicate' does mean 'duplicate me'.
>If duplicate is set to 0, then you tell the engine not to duplicate the
>string, but use it as-is. If it's set to 1, then you tell the engine to
>duplicate it, because this string is either static, or already referenced
>by other things in PHP.
Now I'm confused... :-)
What happens if I actually _want_ to reference the same string?
Say, I get some string from somewhere (say, an argument), then I should use
1 for duplicate, because it is already referenced...
add_index_string(return_value, 0, arg->value.str.val, 1); // $data ==
Then, when I need to create the association (pointing to the same data), I
should use 0, because I don't want the data duplicated...
add_assoc_string(return_value, "zero", arg->value.str.val, 0); //
$data["zero"] == $data == '*arg->value.str.val'
This sequence is actually what I said in my first example, so do I still not
get it, or was my first example not clear enough?
What I didn't say in my first example is that I don't allocate the data
BTW, if I did allocate the data myself, and used a 0 in the first call,
should I still deallocate the data, or is this handled by the engine now?
And if I _do_ use a 1 (so it gets duplicated) then I certainly must
deallocate the date myself, right?
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]