You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* a protected class is visible if it is a subclass of the lexical scope
1056
+
* and the current visibility is protected or private */
1057
+
if (!ce->required_scope_absolute&&instanceof_function(info->ce, ce->required_scope)) {
1058
+
if (current_visibility&ZEND_ACC_PUBLIC) {
1059
+
zend_type_error("Cannot declare protected class %s to a public property in %s::%s", ZSTR_VAL(ce->name), ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
1060
+
returnFAILURE;
1061
+
}
1062
+
1063
+
returnSUCCESS;
1064
+
}
1065
+
1066
+
/* a private class is visible if it is the same class as the lexical scope and the current visibility is private */
1067
+
if (ce->required_scope_absolute&&ce->required_scope==info->ce) {
1068
+
if (current_visibility<ZEND_ACC_PRIVATE) {
1069
+
zend_type_error("Cannot declare private class %s to a %s property in %s::%s", ZSTR_VAL(ce->name), zend_visibility_string(current_visibility), ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
0 commit comments