diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-10-30 22:00:42 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-10-30 22:00:42 +0100 |
commit | cb2884679c25a40fb6edbccc598411dcf0cff9bc (patch) | |
tree | cd8cae8d88ce616a3eeac377166377cd7afe2387 | |
parent | fcc08ce19f39f7ab1381ecc8a010037d41819329 (diff) | |
download | php-git-cb2884679c25a40fb6edbccc598411dcf0cff9bc.tar.gz |
Remove zend_get_parameters(_ex) APIs
zend_get_parameters_ex() has been marked as deprecated for a long
time already. What zend_get_paramers() does is even more
questionable under PHP7. Both functions are obsoleted by the ZPP
mechanism, so I'm dropping them.
-rw-r--r-- | UPGRADING.INTERNALS | 6 | ||||
-rw-r--r-- | Zend/zend_API.c | 61 | ||||
-rw-r--r-- | Zend/zend_API.h | 2 |
3 files changed, 5 insertions, 64 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 65ea83b603..b36e45fc9d 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -15,6 +15,7 @@ PHP 7.2 INTERNALS UPGRADE NOTES l. HASH_FLAG_PERSISTENT m. AST and IS_CONSTANT n. GC_REFCOUNT() + o. zend_get_parameters() 2. Build system changes a. Unix build system changes @@ -100,7 +101,7 @@ PHP 7.2 INTERNALS UPGRADE NOTES attributes are used instead of constant flags. IS_TYPE_CONSTANT flag is removed, but Z_CONSTANT() macro is kept for compatibility. - m. GC_REFCOUNT() is turned into inline function and can't be modified direcly. + n. GC_REFCOUNT() is turned into inline function and can't be modified direcly. All reference-counting operations should be done through corresponding macros GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF(). @@ -108,6 +109,9 @@ PHP 7.2 INTERNALS UPGRADE NOTES GC_REFCOUNT(p)-- into GC_DELREF(p), GC_REFCOUNT(p) = 1 into GC_SET_REFCOUNT(p, 1). + o. The zend_get_parameters() and zend_get_parameters_ex() functions were + removed. Instead zend_parse_parameters() should be used. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 4392c4c12e..24734aa703 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -45,67 +45,6 @@ static zend_module_entry **module_post_deactivate_handlers; static zend_class_entry **class_cleanup_handlers; -/* this function doesn't check for too many parameters */ -ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */ -{ - int arg_count; - va_list ptr; - zval **param, *param_ptr; - - param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1); - arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - - if (param_count>arg_count) { - return FAILURE; - } - - va_start(ptr, param_count); - - while (param_count-->0) { - param = va_arg(ptr, zval **); - if (!Z_ISREF_P(param_ptr) && Z_REFCOUNT_P(param_ptr) > 1) { - zval new_tmp; - - ZVAL_DUP(&new_tmp, param_ptr); - Z_DELREF_P(param_ptr); - ZVAL_COPY_VALUE(param_ptr, &new_tmp); - } - *param = param_ptr; - param_ptr++; - } - va_end(ptr); - - return SUCCESS; -} -/* }}} */ - -/* Zend-optimized Extended functions */ -/* this function doesn't check for too many parameters */ -ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */ -{ - int arg_count; - va_list ptr; - zval **param, *param_ptr; - - param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1); - arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - - if (param_count>arg_count) { - return FAILURE; - } - - va_start(ptr, param_count); - while (param_count-->0) { - param = va_arg(ptr, zval **); - *param = param_ptr; - param_ptr++; - } - va_end(ptr); - - return SUCCESS; -} -/* }}} */ - ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array) /* {{{ */ { zval *param_ptr; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 04706aca31..cc6a7c361d 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -253,8 +253,6 @@ typedef struct _zend_fcall_info_cache { ZEND_API int zend_next_free_module(void); BEGIN_EXTERN_C() -ZEND_API int zend_get_parameters(int ht, int param_count, ...); -ZEND_API ZEND_ATTRIBUTE_DEPRECATED int zend_get_parameters_ex(int param_count, ...); ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array); /* internal function to efficiently copy parameters when executing __call() */ |