diff options
author | Marcus Boerger <helly@php.net> | 2003-11-24 20:57:54 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-11-24 20:57:54 +0000 |
commit | 4dba05d9cc5bf3a03915eed4ec3f72621df6df26 (patch) | |
tree | f81804756353e355c8e7ec65c83d672e403416e8 /Zend/zend_interfaces.c | |
parent | bc4d0082d682513770c99c15a4053f1411e79d73 (diff) | |
download | php-git-4dba05d9cc5bf3a03915eed4ec3f72621df6df26.tar.gz |
Add new interface ArrayAccess to use objects as Arrays
Diffstat (limited to 'Zend/zend_interfaces.c')
-rwxr-xr-x | Zend/zend_interfaces.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 77a8deb6cd..52961b2caa 100755 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -25,6 +25,7 @@ zend_class_entry *zend_ce_traversable; zend_class_entry *zend_ce_aggregate; zend_class_entry *zend_ce_iterator; +zend_class_entry *zend_ce_arrayaccess; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ @@ -344,6 +345,13 @@ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry } /* }}} */ +/* {{{ zend_implement_arrayaccess */ +static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +{ + return SUCCESS; +} +/* }}}*/ + /* {{{ function tables */ zend_function_entry zend_funcs_aggregate[] = { ZEND_ABSTRACT_ME(iterator, getIterator, NULL) @@ -360,6 +368,26 @@ zend_function_entry zend_funcs_iterator[] = { }; zend_function_entry *zend_funcs_traversable = NULL; + +static +ZEND_BEGIN_ARG_INFO(arginfo_arrayaccess_offset, 0) + ZEND_ARG_INFO(0, offset) +ZEND_END_ARG_INFO(); + +static +ZEND_BEGIN_ARG_INFO(arginfo_arrayaccess_offset_value, 0) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO(); + +zend_function_entry zend_funcs_arrayaccess[] = { + ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset) + ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset) + ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) + ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) + {NULL, NULL, NULL} +}; + /* }}} */ #define REGISTER_ITERATOR_INTERFACE(class_name, class_name_str) \ @@ -383,6 +411,8 @@ ZEND_API void zend_register_interfaces(TSRMLS_D) REGISTER_ITERATOR_INTERFACE(iterator, Iterator); REGISTER_ITERATOR_IMPLEMENT(iterator, traversable); + + REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess); } /* }}} */ |