@@ -615,7 +615,7 @@ So now in C, first we must change our ``arg_info``::
615
615
616
616
*1 *, passed in the ``ZEND_ARG_INFO() `` macro tells the engine that argument must be passed by reference.
617
617
618
- Then, when we receive the argument, we use the *"z/ " * argument type, to tell that we want to be given it as a ``zval * ``.
618
+ Then, when we receive the argument, we use the *"z" * argument type, to tell that we want to be given it as a ``zval * ``.
619
619
As we did hint the engine about the fact that it should pass us a reference, we'll be given a reference into that zval,
620
620
aka it will be of type ``IS_REFERENCE ``. We just need to dereference it (that is to fetch the zval stored into the
621
621
zval), and modify it as-is, as the expected behavior of references is that you must modify the value carried by the
@@ -626,7 +626,7 @@ reference::
626
626
double result;
627
627
zval *param;
628
628
629
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/ ", ¶m) == FAILURE) {
629
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶m) == FAILURE) {
630
630
return;
631
631
}
632
632
@@ -638,11 +638,4 @@ reference::
638
638
639
639
Done.
640
640
641
- We used *"z/" *. If you read the `zpp readme <https://github.com/php/php-src/blob/
642
- ef4b2fc283ddaf9bd692015f1db6dad52171c3ce/README.PARAMETER_PARSING_API> `_, you'll notice that the *"/" * tells the engine
643
- to separate the value into the zval.
644
-
645
- Remember that the zval is just a container, it could carry f.e an array (*zend_array *) and that latter could be shared
646
- elsewhere in the engine which would not expect it to be changed.
647
-
648
641
.. note :: The default ``return_value`` value is ``NULL``. If we don't touch it, the function will return PHP's ``NULL``.
0 commit comments