@@ -286,30 +286,6 @@ static zend_never_inline int is_protected_compatible_scope(const zend_class_entr
286286}
287287/* }}} */
288288
289- static int is_asymmetric_set_protected_property_compatible_scope (const zend_property_info * info , const zend_class_entry * scope ) /* {{{ */
290- {
291- zend_class_entry * ce ;
292- /* we need to identify the common protected(set) ancestor: if the prototype has the protected(set), it's straightforward */
293- if (info -> prototype -> flags & ZEND_ACC_PROTECTED_SET ) {
294- ce = info -> prototype -> ce ;
295- } else if (info -> hooks && info -> hooks [ZEND_PROPERTY_HOOK_SET ]) {
296- /* shortcut: the visibility of hooks cannot be overwritten */
297- zend_function * hook = info -> hooks [ZEND_PROPERTY_HOOK_SET ];
298- ce = zend_get_function_root_class (hook );
299- } else {
300- /* we do not have an easy way to find the ancestor which introduces the protected(set), let's iterate */
301- do {
302- ce = info -> ce ;
303- if (!ce -> parent -> properties_info_table ) {
304- break ;
305- }
306- info = ce -> parent -> properties_info_table [OBJ_PROP_TO_NUM (info -> offset )];
307- } while (info -> flags & ZEND_ACC_PROTECTED_SET );
308- }
309- return is_protected_compatible_scope (ce , scope );
310- }
311- /* }}} */
312-
313289static zend_never_inline zend_property_info * zend_get_parent_private_property (zend_class_entry * scope , const zend_class_entry * ce , zend_string * member ) /* {{{ */
314290{
315291 zval * zv ;
@@ -609,7 +585,7 @@ ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_p
609585 return true;
610586 }
611587 return EXPECTED ((prop_info -> flags & ZEND_ACC_PROTECTED_SET )
612- && is_asymmetric_set_protected_property_compatible_scope (prop_info , scope ));
588+ && is_protected_compatible_scope (prop_info -> prototype -> ce , scope ));
613589}
614590
615591static void zend_property_guard_dtor (zval * el ) /* {{{ */ {
0 commit comments