From e77eca7568715ed74f9490cfec1dfcad0960fe08 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 16 Feb 2003 11:15:30 +0000 Subject: [PATCH] namespace patch - static variable access --- Zend/zend_object_handlers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 4e3ed31f64..071d246d85 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -631,6 +631,9 @@ zval **zend_get_static_property(zend_class_entry *ce, char *property_name, int p zend_property_info *property_info; zend_property_info std_property_info; + if(ce->type == ZEND_NAMESPACE) { + zend_hash_find(ce->static_members, property_name, property_name_len+1, (void **) &retval); + } else { if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE) { std_property_info.flags = ZEND_ACC_PUBLIC; std_property_info.name = property_name; @@ -654,6 +657,7 @@ zval **zend_get_static_property(zend_class_entry *ce, char *property_name, int p } tmp_ce = tmp_ce->parent; } + } if (!retval) { switch (type) { @@ -669,9 +673,11 @@ zval **zend_get_static_property(zend_class_entry *ce, char *property_name, int p case BP_VAR_W: { zval *new_zval = &EG(uninitialized_zval); + if(ce->type != ZEND_NAMESPACE) { new_zval->refcount++; zend_hash_quick_update(ce->static_members, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); } + } break; EMPTY_SWITCH_DEFAULT_CASE() } -- 2.40.0