Skip to content

Commit 8596839

Browse files
committed
Explain consumed_args
1 parent 1772a6f commit 8596839

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎docs/source/core/data-structures/fci-fcc.rst‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ There is a set of common parameters used within the callable APIs which are:
5858
the key is numeric (in which case the positional argument is pushed as the next argument
5959
regardless of its index)
6060

61+
- - ``consumed_args``
62+
- ``uint32_t``
63+
- Parameters consumed by the call. See ``zend_fcall_info``.
64+
6165
There are some functions that do not require the use of either the FCI or the FCC structs:
6266

6367
.. list-table:: Basic callable API
@@ -129,7 +133,8 @@ There are some functions that do not require the use of either the FCI or the FC
129133
uint32_t consumed_args
130134
)
131135
132-
- Same as ``zend_call_known_function()``. TODO explain consumed_args uint32_t arg.
136+
- Same as ``zend_call_known_function()``, with an additional ``consumed_args`` parameter (see
137+
``zend_fcall_info``).
133138

134139
- - .. code:: c
135140

@@ -404,7 +409,11 @@ The FCC API is defined in ``Zend/zend_API.h``.
404409
Mandatory field, the number of arguments that will be provided to this call to the function.
405410

406411
``consumed_args``:
407-
TBD new since PHP 8.6. and needs docs
412+
Specifies positional argument whose ownership is transfered to the function being called. This
413+
is used as an optimization to avoid an unnecessary ``Z_ADDREF_P()``/``zval_ptr_dtor()`` when the
414+
value is not used after the call. Only one argument can be specified at once with
415+
``zend_fci_consumed_arg(n)`` (zero-based), and the value must not be a reference.
416+
Must be set to ``0`` when no parameter applies. New since PHP 8.6.
408417

409418
``params``:
410419
contains positional arguments that will be provided to this call to the function. If

0 commit comments

Comments
 (0)