nlopess Sun Jan 22 23:31:08 2006 UTC Removed files: /phpdoc/en/internals/zendapi/figures zend.10-userland.png
Modified files: /phpdoc/en/internals/zendapi calling-user-functions.xml Log: replace another picture by text http://cvs.php.net/viewcvs.cgi/phpdoc/en/internals/zendapi/calling-user-functions.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/internals/zendapi/calling-user-functions.xml diff -u phpdoc/en/internals/zendapi/calling-user-functions.xml:1.1 phpdoc/en/internals/zendapi/calling-user-functions.xml:1.2 --- phpdoc/en/internals/zendapi/calling-user-functions.xml:1.1 Sun Aug 21 16:27:06 2005 +++ phpdoc/en/internals/zendapi/calling-user-functions.xml Sun Jan 22 23:31:08 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> - <!-- $Revision: 1.1 $ --> + <!-- $Revision: 1.2 $ --> <sect1 id="zend.calling-user-functions"> <title>Calling User Functions</title> <para> @@ -72,54 +72,62 @@ <example id='example.call-user-func'> <title>Calling user functions.</title> <programlisting> +<![CDATA[ zval **function_name; zval *retval; -if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &function_name) != SUCCESS)) +if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &function_name) != SUCCESS)) { WRONG_PARAM_COUNT; } -if((*function_name)->type != IS_STRING) +if((*function_name)->type != IS_STRING) { zend_error(E_ERROR, "Function requires string argument"); } TSRMSLS_FETCH(); -if(call_user_function_ex(CG(function_table), NULL, *function_name, &retval, 0, NULL, 0) != SUCCESS) +if(call_user_function_ex(CG(function_table), NULL, *function_name, &retval, 0, NULL, 0) != SUCCESS) { zend_error(E_ERROR, "Function call failed"); } -zend_printf("We have %i as type<br>", retval->type); +zend_printf("We have %i as type\n", retval->type); *return_value = *retval; zval_copy_ctor(return_value); -zval_ptr_dtor(&retval); +zval_ptr_dtor(&retval); +]]> </programlisting> </example> <para/> - <programlisting> -<?php + <programlisting> +<![CDATA[ +<?php dl("call_userland.so"); function test_function() { - - print("We are in the test function!<br>"); - - return("hello"); - + echo "We are in the test function!\n"; + return 'hello'; } $return_value = call_userland("test_function"); -print("Return value: \"$return_value\"<br>"); -?> - </programlisting> - <graphic fileref="figures/zend.10-userland.png"/> +echo "Return value: '$return_value'"; +?> + ]]> + </programlisting> + &example.outputs; + <para> +<![CDATA[ +We are in the test function! +We have 3 as type +Return value: 'hello' +]]> + </para> </sect1> <!-- Keep this comment at the end of the file Local variables: