In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "PHP extension migration to PHP7 extension compatibility parameter adjustment". In daily operation, I believe that many people have doubts about the parameter adjustment of PHP extension migration to PHP7 extension compatibility. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the question of "PHP extension migration to PHP7 extension compatibility parameter adjustment". Next, please follow the editor to study!
Add_assoc_stringl
The method parameters are changed to four.
Add_assoc_stringl (parray, key, value, value_len)
When migrating, simply delete the last parameter.
Add_assoc_string
The method parameters are changed from four to three.
Add_assoc_stringl (parray, key, value)
When migrating, simply delete the last parameter.
Add_next_index_stringl
The method parameters are changed from four to three.
Add_next_index_stringl (parray, value, value_len)
When migrating, simply delete the last parameter.
Add_next_index_string
The method parameters are changed from three to two.
Add_next_index_string (parray, value)
When migrating, simply delete the last parameter.
RETURN_STRINGL
The parameters of the method are changed from three to two.
RETURN_STRINGL (value, length)
When migrating, simply delete the last parameter.
Error: 'INT64_MAX' has not been declared in this scope
The reason is in-depth research. Add a line to # include "php.h"
# include # ifndef INT64_MAX# define INT64_MAX INT64_C (9223372036854775807) # endif#ifndef INT64_MIN# define INT64_MIN (- INT64_C (9223372036854775807)-1) # endif
Solve it.
Create a class
You can refer to the mysqli_objects_new method in the mysqli extension mysqli.c file.
The variable declaration is allocated from the heap to the stack.
For example, the original code was
Zval* sarray_l;ALLOC_INIT_ZVAL (sarray_l); array_init (sarray_l)
Change to
Zval sarray_l;array_init (& sarray_l); zend_hash_get_current_key_ex
The method parameters are changed from six to four.
ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex (const HashTable * ht, zend_string * * str_index, zend_ulong * num_index, HashPosition * pos)
When migrating, simply delete the third and fifth parameters.
Error: 'zealTYPERPP' has not been declared in this scope
There is no Zero type _ PP macro, only the definition of the Z_TYPE and Z_TYPE_P macro methods.
H3 error: cannot convert from 'zend_string*' to' const char*'
String processing in PHP7 is stored using zend_string. If you want to turn zend_string into const char. You need to use the ZSTR_VAL () macro method. The code is as follows:
Zend_string * str;char * sptr;.sptr = ZSTR_VAL (str)
Error: 'IS_BOOL' has not been declared in this scope
There is no IS_BOOL type. It is divided into IS_TRUE and IS_FALSE.
Error: 'Zero BVAL' has not been declared in this scope
There is no ZBVAL macro. But it can be determined by whether the type is IS_TRUE and IS_FALSE.
If the type is IS_TRUE, the value is true. The value is false if the type is IS_FALSE.
Error: 'zend_object_store_get_object' has not been declared in this scope
Add the following code:
Static inline hsf_object * hsf_fetch_object (zend_object * obj) / * {* / {return (user_object *) ((char*) (obj)-XtOffsetOf (user_object, std));} / # define Z_USEROBJ_P (zv) hsf_fetch_object (Z_OBJ_P ((zv)
Then change zend_object_store_get_object to Z_USEROBJ_P.
Note that user_object is the structure you define.
At this point, the study on "PHP extension migration to PHP7 extension compatibility parameter adjustment" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.