]> granicus.if.org Git - php/commitdiff
Remove zend_get_parameters(_ex) APIs
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 30 Oct 2017 21:00:42 +0000 (22:00 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 30 Oct 2017 21:00:42 +0000 (22:00 +0100)
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.

UPGRADING.INTERNALS
Zend/zend_API.c
Zend/zend_API.h

index 65ea83b6037efc5ca6dbd4d3a648d876b59f53a3..b36e45fc9d6af3a772f5304318ad90c2e67c39dc 100644 (file)
@@ -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
 ========================
index 4392c4c12e17ba74c4656cadb8e11e61d8b340c3..24734aa7030ec8ee2890de32431f7f2aef271209 100644 (file)
@@ -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;
index 04706aca31f736623600f03dd5750a4af99f293f..cc6a7c361d0b434448c56734ab3edf33d0c0e66f 100644 (file)
@@ -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() */