summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2001-11-25 08:49:09 +0000
committerAndi Gutmans <andi@php.net>2001-11-25 08:49:09 +0000
commitd2da63f629632c8d7940566a71be66c952b17583 (patch)
tree3fa3f90f76000024b585e278098192f99bbe0421 /Zend/zend_API.c
parent3d741d71c6678ec68e82557d79ebefb6564d0ffd (diff)
downloadphp-git-d2da63f629632c8d7940566a71be66c952b17583.tar.gz
- Support static members. The following script works:
<? class foo { class bar { function init_values() { for ($i=1; $i<10; $i++) { foo::bar::$hello[$i] = $i*$i; } } function print_values() { for ($i=1; $i<10; $i++) { print foo::bar::$hello[$i] . "\n"; } } } } foo::bar::init_values(); foo::bar::print_values(); for ($i=1; $i<10; $i++) { print $hello[$i]?"Shouldn't be printed\n":""; } ?>
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 9eecbdb597..670e2e3c1f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -572,6 +572,7 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
if (!class_type->constants_updated) {
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
+ zend_hash_apply_with_argument(&class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
class_type->constants_updated = 1;
}
@@ -1215,6 +1216,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_
*class_entry->refcount = 1;
class_entry->constants_updated = 0;
zend_hash_init(&class_entry->default_properties, 0, NULL, ZVAL_PTR_DTOR, 1);
+ zend_hash_init(&class_entry->static_members, 0, NULL, ZVAL_PTR_DTOR, 1);
zend_hash_init(&class_entry->function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
zend_hash_init(&class_entry->class_table, 10, NULL, ZEND_CLASS_DTOR, 1);