note 42842 deleted from zend.arguments.by-reference by vrana
| From: | vrana@php.net | Date: | Tue, 15 Mar 2005 10:21:08 +0000 |
| Subject: | note 42842 deleted from zend.arguments.by-reference by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-86466@lists.php.net to get a copy of this message | ||
Note Submitter: soletan
----
Guess "Julien CROUZET jucrouzet_at_cpan.org" is wrong. zval is a struct. Since Zend
provides access on existing zval containers through pointers, you use
zval *ptr;
in your code. Managing a pointer to a pointer as a variable in your code is most unusual,
complicated and sensible in most cases - easy and clear Zend API is not of that sort. A pointer to a
pointer is useful, if a function wants to adjust the pointer pointed to. But that pointer needs some
space in memory, which is done using declaration above (it allocates memory on stack to hold a
single pointer value, of course you can build pointers on this pointer!).
If a function wants to adjust the pointer value, it claims to get a pointer to it in memory, so you
have to pass
&zval
as done in example. (And then this is of type zval **, but only used in this situation!)
However the first note in this list is right.