mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
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.
This commit is contained in:
parent
fcc08ce19f
commit
cb2884679c
3 changed files with 5 additions and 64 deletions
|
@ -15,6 +15,7 @@ PHP 7.2 INTERNALS UPGRADE NOTES
|
||||||
l. HASH_FLAG_PERSISTENT
|
l. HASH_FLAG_PERSISTENT
|
||||||
m. AST and IS_CONSTANT
|
m. AST and IS_CONSTANT
|
||||||
n. GC_REFCOUNT()
|
n. GC_REFCOUNT()
|
||||||
|
o. zend_get_parameters()
|
||||||
|
|
||||||
2. Build system changes
|
2. Build system changes
|
||||||
a. Unix 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
|
attributes are used instead of constant flags. IS_TYPE_CONSTANT flag is
|
||||||
removed, but Z_CONSTANT() macro is kept for compatibility.
|
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
|
All reference-counting operations should be done through corresponding
|
||||||
macros GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF().
|
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)-- into GC_DELREF(p),
|
||||||
GC_REFCOUNT(p) = 1 into GC_SET_REFCOUNT(p, 1).
|
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
|
2. Build system changes
|
||||||
========================
|
========================
|
||||||
|
|
|
@ -45,67 +45,6 @@ static zend_module_entry **module_post_deactivate_handlers;
|
||||||
|
|
||||||
static zend_class_entry **class_cleanup_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) /* {{{ */
|
ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array) /* {{{ */
|
||||||
{
|
{
|
||||||
zval *param_ptr;
|
zval *param_ptr;
|
||||||
|
|
|
@ -253,8 +253,6 @@ typedef struct _zend_fcall_info_cache {
|
||||||
ZEND_API int zend_next_free_module(void);
|
ZEND_API int zend_next_free_module(void);
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
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);
|
ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array);
|
||||||
|
|
||||||
/* internal function to efficiently copy parameters when executing __call() */
|
/* internal function to efficiently copy parameters when executing __call() */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue