]> granicus.if.org Git - php/commitdiff
namespace patch - static variable access
authorStanislav Malyshev <stas@php.net>
Sun, 16 Feb 2003 11:15:30 +0000 (11:15 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 16 Feb 2003 11:15:30 +0000 (11:15 +0000)
Zend/zend_object_handlers.c

index 4e3ed31f64319c67fd8ca63555f2a5fe8fb69f60..071d246d8508d70e4fb359a5b124c7bdb65414ac 100644 (file)
@@ -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()
                }