summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2004-02-12 13:49:55 +0000
committerZeev Suraski <zeev@php.net>2004-02-12 13:49:55 +0000
commite7e0f7d4b4c0187e9838a466f22e9131a49c9a17 (patch)
treebfc8c9bdcd2a5b9ce4571ac975fe2a75a561ea13 /Zend/zend_API.c
parent2c3c75ae556431587074832ff69c49cee0fb4639 (diff)
downloadphp-git-e7e0f7d4b4c0187e9838a466f22e9131a49c9a17.tar.gz
- Check return-by-reference bit when implementing interface prototypes
- Add infrastructure for built-in functions to hint whether they return by reference or not. It is NOT currently used for anything, except for interface prototypes (you can use it to request that the function that implements your prototype returns by reference or doesn't return by reference). For downwards compatibility - by default, interface prototypes are agnostic as to whether the function that implements them returns by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - Fix ArrayAccess::getOffset() to conduct additional checks. If your getOffset() should work with multidimensional arrays - it must return by reference.
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 40e80ff366..0cf80acad0 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1221,10 +1221,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
internal_function->arg_info = ptr->arg_info+1;
internal_function->num_args = ptr->num_args;
internal_function->pass_rest_by_reference = ptr->arg_info[0].pass_by_reference;
+ internal_function->return_reference = ptr->arg_info[0].return_reference;
} else {
internal_function->arg_info = NULL;
internal_function->num_args = 0;
internal_function->pass_rest_by_reference = 0;
+ internal_function->return_reference = 0;
}
if (ptr->flags) {
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {