note 42842 added to zend.arguments.by-reference
| From: | soletan at rn2 dot php dot net | Date: | Mon, 31 May 2004 19:12:53 +0000 |
| Subject: | note 42842 added to zend.arguments.by-reference | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70361@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/zend.arguments.by-reference.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42842
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42842&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42842&report=yes
Search -- http://master.php.net/manage/user-notes.php