Skip to content

Commit 97d3da6

Browse files
author
Julien Pauli
committed
Fixes for fast zpp
1 parent 599ba56 commit 97d3da6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Book/php7/extensions_design/php_functions.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ could mess things up and generate crashes. Always check your parameters, always
321321
variable as you are expecting according to the format string you provided, and of the same type you asked for.
322322
Be logical.
323323

324-
Please, note also the normal procedure of argument parsing. The function zend_parse_parameters() should return SUCCESS
325-
on success or FAILURE on failure. Failure could mean you did not use the ZEND_NUM_ARGS() value but provided a value by
326-
hand (bad idea), or you did something wrong in argument parsing. If it is the case, it's then time to return, abort the
327-
current function (you should return ``void`` from your C function, so just ``return``).
324+
Please, note also the normal procedure of argument parsing. The function ``zend_parse_parameters()`` should return
325+
``SUCCESS`` on success or ``FAILURE`` on failure. Failure could mean you did not use the ``ZEND_NUM_ARGS()`` value but
326+
provided a value by hand (bad idea), or you did something wrong in argument parsing. If it is the case, it's then time
327+
to return, abort the current function (you should return ``void`` from your C function, so just ``return``).
328328

329329
So far so good, we received a double. Let's now perform the math operations and return a result::
330330

@@ -351,16 +351,16 @@ To do that, some ``RETURN_***()`` macros are dedicated as well as some ``RETVAL_
351351
Both just set the type and value of the ``return_value`` zval, but ``RETURN_***()`` ones will follow that by a C
352352
``return`` that will return from that current function.
353353

354-
Alternatively, the API provides alternative macros to handle and parse parameters, It's more readable if you get
354+
Alternatively, the API provides a set of macros to handle and parse parameters. It's more readable if you get
355355
messed with the python style specifiers.
356356

357-
You will need to starting & ending parsing the function parameters with the following macros::
357+
You will need to start and end function parameters parsing with the following macros::
358358

359359
ZEND_PARSE_PARAMETERS_START(min_argument_count, max_argument_count) /* takes two parameters */
360360
/* here we will go with argument lists */
361361
ZEND_PARSE_PARAMETERS_END();
362362

363-
The available parameters macros could be listed as follows (more on the required arguments for those macros later)::
363+
The available parameters macros could be listed as follows::
364364

365365
Z_PARAM_ARRAY() /* old "a" */
366366
Z_PARAM_ARRAY_OR_OBJECT() /* old "A" */
@@ -386,7 +386,7 @@ And to add a parameter as an optional parameter we use the following macro::
386386

387387
Z_PARAM_OPTIONAL /* old "|" */
388388

389-
Here is our example with the new parameters parsing style::
389+
Here is our example with the macro-based parameters parsing style::
390390

391391
PHP_FUNCTION(fahrenheit_to_celsius)
392392
{

0 commit comments

Comments
 (0)