-
-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for php8 #2111
Comments
Yea i guess we will need to prepare stuff for it. I guess feel free anyone to figure out what needs to be done and use open collective funds for it. @dreamsxin would have any time to at least do any review how lot of work this would require? |
Changes: Arg info must be defined. Optimistic estimation: 2 weeks. |
I'm receiving SIGABRT on kernel/fcall https://travis-ci.org/github/ice/framework/jobs/756221697 class Di extends Arr
{
protected static di;
public function __construct(array data = [])
{
parent::__construct(data);
let self::di = this;
} class Arr implements \ArrayAccess, \Countable, \IteratorAggregate
{
protected data = [] { get };
public function __construct(array data = [])
{
let this->data = data;
}
|
@mruz Might be due |
@dreamsxin Currently there are x2 problems:
Problem 1 - Only occur when execute whole tests
Problem 2
|
Bugs 1 - Wrong constructor pick during extension (very strange bug) - Constructor is picked from latest class where is called and extended, in that case
2 - Static methods and its visibility - Static methods that are called not directly
3 - Float (double) strict data type detection
@AlexNDRmac I temporary disabled skipped tests for CI (in case some new PRs) - be6d13e |
#if PHP_VERSION_ID >= 70300
static zend_never_inline zend_function *phalcon_get_function(zend_class_entry *scope, zend_string *function_name)
{
zval *func;
zend_function *fbc;
func = zend_hash_find(&scope->function_table, function_name);
if (func != NULL) {
fbc = Z_FUNC_P(func);
return fbc;
}
return NULL;
}
#if PHP_VERSION_ID >= 80000
static zend_result phalcon_call_user_function(zend_function *fn, zend_class_entry *called_scope, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[])
#else
static int phalcon_call_user_function(zend_function *fn, zend_class_entry *called_scope, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[])
#endif
{
zend_fcall_info fci;
zend_fcall_info_cache fcic;
fci.size = sizeof(fci);
fci.object = object ? Z_OBJ_P(object) : NULL;
ZVAL_COPY_VALUE(&fci.function_name, function_name);
fci.retval = retval_ptr;
fci.param_count = param_count;
fci.params = params;
#if PHP_VERSION_ID >= 80000
fci.named_params = NULL;
#else
fci.no_separation = 1;
#endif
if (fn != NULL) {
fcic.function_handler = fn;
fcic.object = object ? Z_OBJ_P(object) : NULL;
fcic.called_scope = called_scope;
return zend_call_function(&fci, &fcic);
}
return zend_call_function(&fci, NULL);
}
#endif |
@dreamsxin I think this function itself need to be refactored. |
@dreamsxin Could you also check another errors? To not focus on same error together. |
@Jeckerson All ZEND_HOT int phalcon_call_user_method(zend_object *obj, zend_function* fbc, int num_arg, zval *args, zval *ret) /* {{{ */ {
uint32_t i, call_info;
zend_execute_data *call;
if (UNEXPECTED(fbc->common.fn_flags & (ZEND_ACC_PROTECTED|ZEND_ACC_PRIVATE))) {
php_error_docref(NULL, E_WARNING, "cannot call %s method %s::%s()",
(fbc->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) == ZEND_ACC_PROTECTED?
"protected" : "private", ZSTR_VAL(obj->ce->name), ZSTR_VAL(fbc->common.function_name));
return 0;
}
#if PHP_VERSION_ID < 70400
call_info = ZEND_CALL_TOP_FUNCTION;
call = zend_vm_stack_push_call_frame(call_info, fbc, num_arg, NULL, obj);
#else
call_info = ZEND_CALL_TOP_FUNCTION | ZEND_CALL_HAS_THIS;
call = zend_vm_stack_push_call_frame(call_info, fbc, num_arg, obj);
#endif
call->symbol_table = NULL;
for (i = 0; i < num_arg; i++) {
ZVAL_COPY(ZEND_CALL_ARG(call, i+1), &args[i]);
}
/* At least we should in calls of Dispatchers */
ZEND_ASSERT(EG(current_execute_data));
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
return phalcon_do_call_user_method(call, fbc, ret);
} else {
ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION);
call->prev_execute_data = EG(current_execute_data);
EG(current_execute_data) = call;
if (EXPECTED(zend_execute_internal == NULL)) {
fbc->internal_function.handler(call, ret);
} else {
zend_execute_internal(call, ret);
}
EG(current_execute_data) = call->prev_execute_data;
zend_vm_stack_free_args(call);
zend_vm_stack_free_call_frame(call);
if (UNEXPECTED(EG(exception))) {
/* We should return directly to user codes */
ZVAL_UNDEF(ret);
return 0;
}
return 1;
}
} |
@dreamsxin Could you please specify exactly where? |
@Jeckerson ZEPHIR_CALL_FUNCTION(return_value, "self::parentfunction", NULL, 0);
# or
ZEPHIR_CALL_FUNCTION(return_value, "parent::parentfunction", NULL, 0);
ZEPHIR_CALL_PARENT(NULL, stub_oo_extendpdoclass_ce, getThis(), "__construct", NULL, 0, &dsn, &username, &password, attrs);
...
// fcall.c
case zephir_fcall_parent:
assert(ce);
zend_string_addref(ce->parent->name);
ZVAL_STR(&q, ce->parent->name);
ZEND_HASH_FILL_ADD(&q);
break; |
By changing from:
to:
Gives Segmentation fault |
Thanks @dreamsxin I'll try to replace this function call |
I still have issues with constructor #2111 (comment)
|
@mruz try with |
It compiled, a few of my tests failed, so I had to fix some type errors on my side. |
@mruz So all worked in general? |
Yes, all good 🎉 |
Hello! I found a bug in the For example, the following code:
Command
The generated file ...
ZEPHIR_INIT_CLASS(Stub_Bug_MyClass) {
ZEPHIR_REGISTER_CLASS(Stub\\Bug, MyClass, stub, bug_myclass, stub_bug_myclass_method_entry, 0);
return SUCCESS;
}
PHP_METHOD(Stub_Bug_MyClass, setParam) {
zval *parameter, parameter_sub;
zval *this_ptr = getThis();
ZVAL_UNDEF(¶meter_sub);
#if PHP_VERSION_ID >= 80000
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(parameter, stub_bug_param_ce)
+ Z_PARAM_OBJECT_OF_CLASS(parameter, stub_bug_a_b_param_ce)
ZEND_PARSE_PARAMETERS_END();
#endif
zephir_fetch_params_without_memory_grow(1, 0, ¶meter);
RETVAL_ZVAL(parameter, 1, 0);
return;
} Current solution is to import class with the use statement:
|
Related #2165 |
Added support for PHP8.0 in |
It appears from this thread that Zephir is officially ready for PHP 8.0 ? If i am not wrong, can you also reflect that on official documentation of Zephir ? like on installation page, where version is shown as 7.3.7 |
Add php 8.0 support. We have feature freeze and beta1 now https://wiki.php.net/todo/php80.
It's disabled in composer/build. Can we enable (with allowed failures) and see what's failing?
Would be good if it's ready on Nov 26 2020 (GA).
The text was updated successfully, but these errors were encountered: