diff options
-rw-r--r-- | UPGRADING.INTERNALS | 6 | ||||
-rw-r--r-- | Zend/zend_API.c | 1 | ||||
-rw-r--r-- | Zend/zend_API.h | 7 | ||||
-rw-r--r-- | Zend/zend_closures.c | 1 | ||||
-rw-r--r-- | Zend/zend_exceptions.c | 1 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 9 | ||||
-rw-r--r-- | ext/curl/interface.c | 5 | ||||
-rw-r--r-- | ext/dom/xpath.c | 1 | ||||
-rw-r--r-- | ext/ffi/ffi.c | 1 | ||||
-rw-r--r-- | ext/intl/converter/converter.c | 2 | ||||
-rw-r--r-- | ext/libxml/libxml.c | 1 | ||||
-rw-r--r-- | ext/mysqli/mysqli.c | 1 | ||||
-rw-r--r-- | ext/pcre/php_pcre.c | 1 | ||||
-rw-r--r-- | ext/pdo/pdo_dbh.c | 1 | ||||
-rw-r--r-- | ext/pdo/pdo_stmt.c | 1 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 1 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 3 | ||||
-rw-r--r-- | ext/soap/soap.c | 1 | ||||
-rw-r--r-- | ext/spl/spl_directory.c | 1 | ||||
-rw-r--r-- | ext/spl/spl_engine.h | 1 | ||||
-rw-r--r-- | ext/spl/spl_iterators.c | 1 | ||||
-rw-r--r-- | ext/sqlite3/sqlite3.c | 1 | ||||
-rw-r--r-- | ext/standard/array.c | 8 | ||||
-rw-r--r-- | ext/xml/xml.c | 1 | ||||
-rw-r--r-- | ext/xsl/xsltprocessor.c | 1 | ||||
-rw-r--r-- | main/streams/userspace.c | 1 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_prompt.c | 1 |
27 files changed, 10 insertions, 50 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index efa8fdd754..a9a6553466 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -19,6 +19,7 @@ PHP 8.0 INTERNALS UPGRADE NOTES p. ARG_COUNT() macro removed q. GC_COLLECTABLE flag r. Cannot implement Traversable only + s. zend_fcall_info no_separation flag removed 2. Build system changes a. Abstract @@ -135,6 +136,11 @@ PHP 8.0 INTERNALS UPGRADE NOTES zend_create_internal_iterator_zval(return_value, ZEND_THIS); } + s. The zend_fcall_info no_separation flag has been removed, and separation is + never allowed. If you wish to pass (or allow passing) arguments by + reference, explicitly create those arguments as references using + ZEND_MAKE_REF. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 4aa0103ae5..8fd319ea2e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3342,7 +3342,6 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fca fci->retval = NULL; fci->param_count = 0; fci->params = NULL; - fci->no_separation = 1; return SUCCESS; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 1adfbacb05..0d019711cb 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -46,7 +46,6 @@ typedef struct _zend_fcall_info { zval *retval; zval *params; zend_object *object; - zend_bool no_separation; uint32_t param_count; } zend_fcall_info; @@ -498,12 +497,10 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zv #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value) -ZEND_API int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation); +ZEND_API int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]); #define call_user_function(_unused, object, function_name, retval_ptr, param_count, params) \ - _call_user_function_ex(object, function_name, retval_ptr, param_count, params, 1) -#define call_user_function_ex(_unused, object, function_name, retval_ptr, param_count, params, no_separation, _unused2) \ - _call_user_function_ex(object, function_name, retval_ptr, param_count, params, no_separation) + _call_user_function_ex(object, function_name, retval_ptr, param_count, params) ZEND_API extern const zend_fcall_info empty_fcall_info; ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 7331188228..a0d6450c5e 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -167,7 +167,6 @@ ZEND_METHOD(Closure, call) fci.size = sizeof(fci); ZVAL_OBJ(&fci.function_name, &closure->std); fci.retval = &closure_result; - fci.no_separation = 1; if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(closure_result) != IS_UNDEF) { if (Z_ISREF(closure_result)) { diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 4954a1bd5b..0103422f94 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -659,7 +659,6 @@ ZEND_METHOD(Exception, __toString) fci.retval = &trace; fci.param_count = 0; fci.params = NULL; - fci.no_separation = 1; zend_call_function(&fci, NULL); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ab5766af27..6a2b82f96d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -619,7 +619,7 @@ ZEND_API int zval_update_constant(zval *pp) /* {{{ */ } /* }}} */ -int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation) /* {{{ */ +int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]) /* {{{ */ { zend_fcall_info fci; @@ -629,7 +629,6 @@ int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, fci.retval = retval_ptr; fci.param_count = param_count; fci.params = params; - fci.no_separation = (zend_bool) no_separation; return zend_call_function(&fci, NULL); } @@ -737,10 +736,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) { if (UNEXPECTED(!Z_ISREF_P(arg))) { - if (!fci->no_separation) { - /* Separation is enabled -- create a ref */ - ZVAL_NEW_REF(arg, arg); - } else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) { + if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) { /* By-value send is not allowed -- emit a warning, * but still perform the call with a by-value send. */ zend_param_must_be_ref(func, i + 1); @@ -866,7 +862,6 @@ ZEND_API void zend_call_known_function( fci.retval = retval_ptr ? retval_ptr : &retval; fci.param_count = param_count; fci.params = params; - fci.no_separation = 1; ZVAL_UNDEF(&fci.function_name); /* Unused */ fcic.function_handler = fn; diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 6f5a79c42f..e129c7708d 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1385,7 +1385,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) fci.retval = &retval; fci.param_count = 2; fci.params = argv; - fci.no_separation = 1; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1432,7 +1431,6 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) fci.retval = &retval; fci.param_count = 3; fci.params = argv; - fci.no_separation = 1; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1485,7 +1483,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double fci.retval = &retval; fci.param_count = 5; fci.params = argv; - fci.no_separation = 1; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1541,7 +1538,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) fci.retval = &retval; fci.param_count = 3; fci.params = argv; - fci.no_separation = 1; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1603,7 +1599,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx fci.retval = &retval; fci.param_count = 2; fci.params = argv; - fci.no_separation = 1; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 83a0581ce4..b3181972ca 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -151,7 +151,6 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, fci.object = NULL; fci.retval = &retval; - fci.no_separation = 1; if (!zend_make_callable(&fci.function_name, &callable)) { php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable)); diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 60e4679f29..22a11f692d 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -857,7 +857,6 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v fci.retval = &retval; fci.params = do_alloca(sizeof(zval) *callback_data->arg_count, use_heap); fci.object = NULL; - fci.no_separation = 1; fci.param_count = callback_data->arg_count; if (callback_data->type->func.args) { diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index efb4df279e..5151daaa36 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -229,7 +229,6 @@ static void php_converter_to_u_callback(const void *context, objval->to_cb.param_count = 4; objval->to_cb.params = zargs; objval->to_cb.retval = &retval; - objval->to_cb.no_separation = 1; if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) { /* Unlikely */ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()"); @@ -312,7 +311,6 @@ static void php_converter_from_u_callback(const void *context, objval->from_cb.param_count = 4; objval->from_cb.params = zargs; objval->from_cb.retval = &retval; - objval->from_cb.no_separation = 1; if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) { /* Unlikely */ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()"); diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 98402e2e49..5fd571d57b 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -566,7 +566,6 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL, fci->retval = &retval; fci->params = params; fci->param_count = sizeof(params)/sizeof(*params); - fci->no_separation = 1; status = zend_call_function(fci, &LIBXML(entity_loader).fcc); if (status != SUCCESS || Z_ISUNDEF(retval)) { diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index f832352edb..0d1c34d7fc 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1227,7 +1227,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags fci.retval = &retval; fci.params = NULL; fci.param_count = 0; - fci.no_separation = 1; if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) { diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 7aaaf3f695..16ec75d02b 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1529,7 +1529,6 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach fci->retval = &retval; fci->param_count = 1; fci->params = &arg; - fci->no_separation = 1; if (zend_call_function(fci, fcc) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { if (EXPECTED(Z_TYPE(retval) == IS_STRING)) { diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index b80bdf60d4..9c6c635cce 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -437,7 +437,6 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt fci.retval = &retval; fci.param_count = 0; fci.params = NULL; - fci.no_separation = 1; zend_fcall_info_args(&fci, ctor_args); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5a49491e32..9b13ad8887 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -655,7 +655,6 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ fci->retval = &stmt->fetch.cls.retval; fci->param_count = 0; fci->params = NULL; - fci->no_separation = 1; zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 442d09af04..5b3dc9a80c 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2584,7 +2584,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ fci.retval = &retval; fci.params = NULL; fci.param_count = 0; - fci.no_separation = 1; if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) { diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4897fbb822..9b8c34e4dd 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1816,7 +1816,6 @@ ZEND_METHOD(ReflectionFunction, invoke) fci.retval = &retval; fci.param_count = num_args; fci.params = params; - fci.no_separation = 1; fcc.function_handler = fptr; fcc.called_scope = NULL; @@ -1878,7 +1877,6 @@ ZEND_METHOD(ReflectionFunction, invokeArgs) fci.retval = &retval; fci.param_count = argc; fci.params = params; - fci.no_separation = 1; fcc.function_handler = fptr; fcc.called_scope = NULL; @@ -3206,7 +3204,6 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) fci.retval = &retval; fci.param_count = argc; fci.params = params; - fci.no_separation = 1; fcc.function_handler = mptr; fcc.called_scope = intern->ce; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index a18f085c07..4a5742fdeb 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -654,7 +654,6 @@ PHP_METHOD(SoapFault, __toString) fci.retval = &trace; fci.param_count = 0; fci.params = NULL; - fci.no_separation = 1; zend_call_function(&fci, NULL); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 6053d75ac8..b53c2b8722 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1904,7 +1904,6 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function fci.retval = return_value; fci.param_count = num_args; fci.params = params; - fci.no_separation = 1; ZVAL_STR(&fci.function_name, func_ptr->common.function_name); fcic.function_handler = func_ptr; diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index 44c6867e03..b7fbb69f59 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -63,7 +63,6 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in fci.retval = &dummy; fci.param_count = argc; fci.params = argv; - fci.no_separation = 1; fcc.function_handler = func; fcc.called_scope = pce; diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 9e4ed5036f..d7dac8ac68 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1785,7 +1785,6 @@ PHP_METHOD(CallbackFilterIterator, accept) fci->retval = return_value; fci->param_count = 3; fci->params = params; - fci->no_separation = 1; if (zend_call_function(fci, fcc) != SUCCESS || Z_ISUNDEF_P(return_value)) { RETURN_FALSE; diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 58696c01bb..af7304c5f5 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -2146,7 +2146,6 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c fci->retval = &retval; fci->param_count = 5; fci->params = argv; - fci->no_separation = 1; int authreturn = SQLITE_DENY; diff --git a/ext/standard/array.c b/ext/standard/array.c index 3eb06bd3c4..ab9d020e94 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -921,7 +921,6 @@ static inline int php_array_user_compare_unstable(Bucket *f, Bucket *s) /* {{{ * BG(user_compare_fci).param_count = 2; BG(user_compare_fci).params = args; BG(user_compare_fci).retval = &retval; - BG(user_compare_fci).no_separation = 1; call_failed = zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE || Z_TYPE(retval) == IS_UNDEF; zval_ptr_dtor(&args[1]); zval_ptr_dtor(&args[0]); @@ -1063,7 +1062,6 @@ static inline int php_array_user_key_compare_unstable(Bucket *f, Bucket *s) /* { BG(user_compare_fci).param_count = 2; BG(user_compare_fci).params = args; BG(user_compare_fci).retval = &retval; - BG(user_compare_fci).no_separation = 1; call_failed = zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE || Z_TYPE(retval) == IS_UNDEF; zval_ptr_dtor(&args[1]); zval_ptr_dtor(&args[0]); @@ -1374,7 +1372,6 @@ static int php_array_walk(zval *array, zval *userdata, int recursive) /* {{{ */ BG(array_walk_fci).retval = &retval; BG(array_walk_fci).param_count = userdata ? 3 : 2; BG(array_walk_fci).params = args; - BG(array_walk_fci).no_separation = 1; zend_hash_internal_pointer_reset_ex(target_hash, &pos); ht_iter = zend_hash_iterator_add(target_hash, pos); @@ -4546,7 +4543,6 @@ static int zval_user_compare(zval *a, zval *b) /* {{{ */ BG(user_compare_fci).param_count = 2; BG(user_compare_fci).params = args; BG(user_compare_fci).retval = &retval; - BG(user_compare_fci).no_separation = 1; if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { zend_long ret = zval_get_long(&retval); @@ -5906,7 +5902,6 @@ PHP_FUNCTION(array_reduce) fci.retval = &retval; fci.param_count = 2; - fci.no_separation = 1; ZEND_HASH_FOREACH_VAL(htbl, operand) { ZVAL_COPY_VALUE(&args[0], return_value); @@ -5959,7 +5954,6 @@ PHP_FUNCTION(array_filter) if (ZEND_FCI_INITIALIZED(fci)) { have_callback = 1; - fci.no_separation = 1; fci.retval = &retval; if (use_type == ARRAY_FILTER_USE_BOTH) { fci.param_count = 2; @@ -6062,7 +6056,6 @@ PHP_FUNCTION(array_map) fci.retval = &result; fci.param_count = 1; fci.params = &arg; - fci.no_separation = 1; ZVAL_COPY(&arg, zv); ret = zend_call_function(&fci, &fci_cache); @@ -6151,7 +6144,6 @@ PHP_FUNCTION(array_map) fci.retval = &result; fci.param_count = n_arrays; fci.params = params; - fci.no_separation = 1; if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { efree(array_pos); diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 60bdfb4261..476d77444c 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -464,7 +464,6 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f fci.retval = retval; fci.param_count = argc; fci.params = argv; - fci.no_separation = 1; result = zend_call_function(&fci, NULL); if (result == FAILURE) { diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index b63814e236..0dc909d9d0 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -245,7 +245,6 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t ZVAL_COPY_VALUE(&fci.function_name, &handler); fci.object = NULL; fci.retval = &retval; - fci.no_separation = 1; if (!zend_make_callable(&handler, &callable)) { if (!EG(exception)) { php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable)); diff --git a/main/streams/userspace.c b/main/streams/userspace.c index ae00187483..ee74d49bde 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -308,7 +308,6 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php fci.retval = &retval; fci.param_count = 0; fci.params = NULL; - fci.no_separation = 1; fcc.function_handler = uwrap->ce->constructor; fcc.called_scope = Z_OBJCE_P(object); diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index f6b5ef41e5..2c58ffc3fb 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -122,7 +122,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ //???fci.symbol_table = zend_rebuild_symbol_table(); fci.object = NULL; fci.retval = &fretval; - fci.no_separation = 1; if (name->next) { zval params; |