Skip to content
Permalink
Browse files

Initialise statics for PHP 7.4

  • Loading branch information...
derickr committed May 23, 2019
1 parent 32620c3 commit 9cf12370839202e5923dbf7b3a28b422d9c1bbd9
Showing with 17 additions and 0 deletions.
  1. +6 −0 xdebug_handler_dbgp.c
  2. +11 −0 xdebug_var.c
@@ -1880,6 +1880,12 @@ static int attach_context_vars(xdebug_xml_node *node, xdebug_var_export_options
if (fse->function.type == XFUNC_STATIC_MEMBER) {
zend_class_entry *ce = xdebug_fetch_class(fse->function.class, strlen(fse->function.class), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);

#if PHP_VERSION_ID >= 70400
if (ce->type == ZEND_INTERNAL_CLASS || (ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
zend_class_init_statics(ce);
}
#endif

xdebug_attach_static_vars(node, options, ce TSRMLS_CC);
}

@@ -327,6 +327,11 @@ static void fetch_zval_from_symbol_table(
case XF_ST_STATIC_ROOT:
case XF_ST_STATIC_PROPERTY:
/* First we try a public,private,protected property */
#if PHP_VERSION_ID >= 70400
if (cce && (cce->type == ZEND_INTERNAL_CLASS || (cce->ce_flags & ZEND_ACC_IMMUTABLE))) {
zend_class_init_statics(cce);
}
#endif
element = prepare_search_key(name, &element_length, "", 0);
if (cce && ((zpp = zend_hash_str_find_ptr(&cce->properties_info, element, element_length)) != NULL) && CE_STATIC_MEMBERS(cce)) {
ZVAL_COPY(&tmp_retval, &CE_STATIC_MEMBERS(cce)[zpp->offset]);
@@ -2151,6 +2156,12 @@ void xdebug_var_export_xml_node(zval **struc, xdebug_str *name, xdebug_xml_node
/* Adding static properties */
xdebug_zend_hash_apply_protection_begin(&ce->properties_info);

#if PHP_VERSION_ID >= 70400
if (ce->type == ZEND_INTERNAL_CLASS || (ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
zend_class_init_statics(ce);
}
#endif

ZEND_HASH_FOREACH_PTR(&ce->properties_info, zpi_val) {
object_item_add_zend_prop_to_merged_hash(zpi_val, merged_hash, (int) XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY, ce);
} ZEND_HASH_FOREACH_END();

0 comments on commit 9cf1237

Please sign in to comment.
You can’t perform that action at this time.