]> granicus.if.org Git - php/commitdiff
[ci skip] Document zend_parse_parameters_none()
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 3 Jul 2018 16:58:07 +0000 (18:58 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 3 Jul 2018 16:58:37 +0000 (18:58 +0200)
README.PARAMETER_PARSING_API

index 7f3da76f8081ec44c4bece41a88da6f2d1c4341a..1f00c33572e7380870b2c2fdf8d4fcee2cc05b9f 100644 (file)
@@ -28,6 +28,13 @@ Both functions return SUCCESS or FAILURE depending on the result.
 The auto-conversions are performed as necessary. Arrays, objects, and
 resources cannot be auto-converted.
 
+PHP 5.3 includes a new function (actually implemented as macro):
+
+int zend_parse_parameters_none();
+
+This returns SUCCESS if no argument has been passed to the function,
+FAILURE otherwise.
+
 PHP 5.5 includes a new function:
 
 int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
@@ -221,3 +228,8 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs
 for (i = 0; i < num_varargs; i++) {
     /* do something with varargs[i] */
 }
+
+/* Function that doesn't accept any arguments */
+if (zend_parse_parameters_none() == FAILURE) {
+    return;
+}