cvs: ZendAPI / Extending_Zend_Variables.xml
| From: | Sara Golemon | Date: | Mon, 13 Jan 2003 16:22:31 +0000 |
| Subject: | cvs: ZendAPI / Extending_Zend_Variables.xml | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-808@lists.php.net to get a copy of this message | ||
pollita Mon Jan 13 11:22:31 2003 EDT
Modified files:
/ZendAPI Extending_Zend_Variables.xml
Log:
Added function definitions for add_(assoc|index|next_index)_zval and changed examples using
array_init to reflect that it does not return any value other than
SUCCESS
Index: ZendAPI/Extending_Zend_Variables.xml
diff -u ZendAPI/Extending_Zend_Variables.xml:1.8 ZendAPI/Extending_Zend_Variables.xml:1.9
--- ZendAPI/Extending_Zend_Variables.xml:1.8 Mon Mar 25 03:13:46 2002
+++ ZendAPI/Extending_Zend_Variables.xml Mon Jan 13 11:22:31 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!-- $Revision: 1.8 $ -->
+ <!-- $Revision: 1.9 $ -->
<chapter id="zend.variables">
<title>Creating Variables</title>
<para>
@@ -327,13 +327,9 @@
MAKE_STD_ZVAL(new_array);
-if(array_init(new_array) != SUCCESS)
-{
- // do error handling here
-}
+array_init(new_array);
</programlisting>
- If <function>array_init</function> fails to create a
- new array, it returns <literal>FAILURE</literal>.
+ <function>array_init</function> always returns
<literal>SUCCESS</literal>.
</para>
<para>
To add new elements to the array, you can use numerous functions,
@@ -412,6 +408,10 @@
<function>add_assoc_string</function>.
</entry>
</row>
+ <row>
+ <entry colname="col1"><function>add_assoc_zval(zval *array, char
*key, zval *value);</function></entry>
+ <entry colname="col2">Adds a zval to the array. Useful for adding other
arrays, objects, streams, etc...</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -469,6 +469,10 @@
<entry colname="col2">Adds a string with the desired
length <envar>length</envar> to the array. This function is faster and
binary-safe. Otherwise, behaves like
<function>add_index_string()</function>.</entry>
</row>
+ <row>
+ <entry colname="col1"><function>add_index_zval(zval *array, uint idx,
zval *value);</function></entry>
+ <entry colname="col2">Adds a zval to the array. Useful for adding other
arrays, objects, streams, etc...</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -526,6 +530,10 @@
<entry colname="col2">Adds a string with the desired
length <envar>length</envar> to the array. This function is faster and
binary-safe. Otherwise, behaves like
<function>add_index_string()</function>.</entry>
</row>
+ <row>
+ <entry colname="col1"><function>add_next_index_zval(zval *array, zval
*value);</function></entry>
+ <entry colname="col2">Adds a zval to the array. Useful for adding other
arrays, objects, streams, etc...</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -546,10 +554,7 @@
MAKE_STD_ZVAL(new_array);
MAKE_STD_ZVAL(new_element);
-if(array_init(new_array) == FAILURE)
-{
- // do error handling here
-}
+array_init(new_array);
ZVAL_LONG(new_element, 10);
@@ -568,10 +573,7 @@
MAKE_STD_ZVAL(new_array);
MAKE_STD_ZVAL(new_element);
-if(array_init(new_array) == FAILURE)
-{
- // do error handling here
-}
+array_init(new_array);
ZVAL_LONG(new_element, 10);