0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-10-18 07:58:41 +00:00

eliminate PHP_MAJOR_VERSION checks

This commit is contained in:
Stefan Siegl 2022-05-30 14:15:00 +02:00
parent 10cd73a03d
commit 6be2206aab
3 changed files with 0 additions and 25 deletions

View File

@ -35,10 +35,6 @@ static zval v8js_array_access_dispatch(zend_object *object, const char *method_n
zval php_value; zval php_value;
fci.size = sizeof(fci); fci.size = sizeof(fci);
#if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
fci.function_table = &object->ce->function_table;
fci.symbol_table = NULL;
#endif
ZVAL_STRING(&fci.function_name, method_name); ZVAL_STRING(&fci.function_name, method_name);
fci.retval = &php_value; fci.retval = &php_value;
@ -50,11 +46,7 @@ static zval v8js_array_access_dispatch(zend_object *object, const char *method_n
fci.params = params; fci.params = params;
fci.object = object; fci.object = object;
#if (PHP_MAJOR_VERSION < 8)
fci.no_separation = 0;
#else
fci.named_params = NULL; fci.named_params = NULL;
#endif
zend_call_function(&fci, NULL); zend_call_function(&fci, NULL);
zval_dtor(&fci.function_name); zval_dtor(&fci.function_name);

View File

@ -311,13 +311,8 @@ V8JS_METHOD(require)
ZVAL_STRING(&params[0], module_base_cstr); ZVAL_STRING(&params[0], module_base_cstr);
ZVAL_STRING(&params[1], module_id); ZVAL_STRING(&params[1], module_id);
#if (PHP_MAJOR_VERSION < 8)
call_result = call_user_function_ex(EG(function_table), NULL, &c->module_normaliser,
&normaliser_result, 2, params, 0, NULL);
#else
call_result = call_user_function(EG(function_table), NULL, &c->module_normaliser, call_result = call_user_function(EG(function_table), NULL, &c->module_normaliser,
&normaliser_result, 2, params); &normaliser_result, 2, params);
#endif
} }
isolate->Enter(); isolate->Enter();
@ -440,11 +435,7 @@ V8JS_METHOD(require)
zend_try { zend_try {
ZVAL_STRING(&params[0], normalised_module_id); ZVAL_STRING(&params[0], normalised_module_id);
#if (PHP_MAJOR_VERSION < 8)
call_result = call_user_function_ex(EG(function_table), NULL, &c->module_loader, &module_code, 1, params, 0, NULL);
#else
call_result = call_user_function(EG(function_table), NULL, &c->module_loader, &module_code, 1, params); call_result = call_user_function(EG(function_table), NULL, &c->module_loader, &module_code, 1, params);
#endif
} }
zend_catch { zend_catch {
v8js_terminate_execution(isolate); v8js_terminate_execution(isolate);

View File

@ -59,10 +59,6 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, c
/* zend_fcall_info */ /* zend_fcall_info */
fci.size = sizeof(fci); fci.size = sizeof(fci);
#if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
fci.function_table = &object->ce->function_table;
fci.symbol_table = NULL;
#endif
fci.function_name = fname; fci.function_name = fname;
fci.object = object; fci.object = object;
fci.retval = &retval; fci.retval = &retval;
@ -137,11 +133,7 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, c
} else { } else {
fci.params = NULL; fci.params = NULL;
} }
#if (PHP_MAJOR_VERSION < 8)
fci.no_separation = 1;
#else
fci.named_params = NULL; fci.named_params = NULL;
#endif
info.GetReturnValue().Set(V8JS_NULL); info.GetReturnValue().Set(V8JS_NULL);
{ {