You might run into a situation in which you need write access to a
parameter that's retrieved with zend_get_parameters_ex()
but not passed by reference. For this case, you can use the macro
SEPARATE_ZVAL, which does a zval separation on the provided
container. The newly generated zval is detached from internal
data and has only a local scope, meaning that it can be changed or destroyed
without implying global changes in the script context:
zval **parameter;
/* retrieve parameter */
zend_get_parameters_ex(1, ¶meter);
/* at this stage, <parameter> still is connected */
/* to Zend's internal data buffers */
/* make <parameter> write-safe */
SEPARATE_ZVAL(parameter);
/* now we can safely modify <parameter> */
/* without implying global changes */
SEPARATE_ZVAL uses emalloc()
to allocate the new zval container, which means that even if you
don't deallocate this memory yourself, it will be destroyed automatically upon
script termination. However, doing a lot of calls to this macro
without freeing the resulting containers will clutter up your RAM.
Note: As you can easily work around the lack
of write access in the "traditional" API (with
zend_get_parameters() and so on), this API
seems to be obsolete, and is not discussed further in this
chapter.
Php zend.arguments.write safety Function syntax tag
zend.arguments.write safety php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php zend.arguments.write safety syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.