Skip to content

Commit

Permalink
Fix PHP8 compatibility (named params) (#3598)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Aug 27, 2020
1 parent e360010 commit 78c2826
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion php_swoole.h
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,9 @@ static sw_inline int sw_zend_call_function_ex(zval *function_name, zend_fcall_in
fci.retval = retval ? retval : &_retval;
fci.param_count = param_count;
fci.params = params;
#if PHP_VERSION_ID < 80000
#if PHP_VERSION_ID >= 80000
fci.named_params = NULL;
#else
fci.no_separation = 0;
#endif

Expand Down
6 changes: 4 additions & 2 deletions swoole_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1611,11 +1611,13 @@ static PHP_FUNCTION(swoole_user_func_handler) {
zend_fcall_info fci;
fci.size = sizeof(fci);
fci.object = nullptr;
fci.function_name = {};
ZVAL_UNDEF(&fci.function_name);
fci.retval = return_value;
fci.param_count = ZEND_NUM_ARGS();
fci.params = ZEND_CALL_ARG(execute_data, 1);
#if PHP_VERSION_ID < 80000
#if PHP_VERSION_ID >= 80000
fci.named_params = NULL;
#else
fci.no_separation = 1;
#endif

Expand Down

0 comments on commit 78c2826

Please sign in to comment.