note 41362 added to zend.returning
| From: | JulienCROUZETjucrouzet_at_cpan dot org at rn2 dot php dot net | Date: | Wed, 07 Apr 2004 18:44:31 +0000 |
| Subject: | note 41362 added to zend.returning | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67771@lists.php.net to get a copy of this message | ||
Just an example of the way of the way of returning array :
/*
** Creates a array of on element (a long of value 42)
*/
ZEND_FUNCTION("make_42_array")
{
zval *my_long;
// Declaring and allocating return_value to be an array
array_init(return_value);
//Creates and assign the long element at (long)42
MAKE_STD_ZVAL(my_long);
ZVAL_LONG(new_element, 42);
//Make this our $array[0] I do not use add_index_long to
//to show a "by-hand" assignation
zend_hash_index_update(HASH_OF(return_value), 0, (void *)&my_long, sizeof(zval *), NULL);
//Returns nothing to satisfy the void prototype
return ;
}
----
Manual Page -- http://www.php.net/manual/en/zend.returning.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41362
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41362&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41362&report=yes
Search -- http://master.php.net/manage/user-notes.php