@@ -321,10 +321,10 @@ could mess things up and generate crashes. Always check your parameters, always
321
321
variable as you are expecting according to the format string you provided, and of the same type you asked for.
322
322
Be logical.
323
323
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 ``).
328
328
329
329
So far so good, we received a double. Let's now perform the math operations and return a result::
330
330
@@ -351,16 +351,16 @@ To do that, some ``RETURN_***()`` macros are dedicated as well as some ``RETVAL_
351
351
Both just set the type and value of the ``return_value `` zval, but ``RETURN_***() `` ones will follow that by a C
352
352
``return `` that will return from that current function.
353
353
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
355
355
messed with the python style specifiers.
356
356
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::
358
358
359
359
ZEND_PARSE_PARAMETERS_START(min_argument_count, max_argument_count) /* takes two parameters */
360
360
/* here we will go with argument lists */
361
361
ZEND_PARSE_PARAMETERS_END();
362
362
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::
364
364
365
365
Z_PARAM_ARRAY() /* old "a" */
366
366
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::
386
386
387
387
Z_PARAM_OPTIONAL /* old "|" */
388
388
389
- Here is our example with the new parameters parsing style::
389
+ Here is our example with the macro-based parameters parsing style::
390
390
391
391
PHP_FUNCTION(fahrenheit_to_celsius)
392
392
{
0 commit comments