diff options
author | Zeev Suraski <zeev@php.net> | 2004-02-10 09:30:38 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2004-02-10 09:30:38 +0000 |
commit | e8e9b2afee32e27873be715cbbc45674ccbb8d91 (patch) | |
tree | efde7770c384b22b00d7a681e0720e2d0a8cf783 /ext/simplexml | |
parent | 439396188cc782f5020899363a8435556affecc4 (diff) | |
download | php-git-e8e9b2afee32e27873be715cbbc45674ccbb8d91.tar.gz |
Implement get callback for SimpleXML (it now supports pre/post increment
as well as binary-assign-ops)
Diffstat (limited to 'ext/simplexml')
-rw-r--r-- | ext/simplexml/simplexml.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index b7735f80b1..7749013ff3 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1013,6 +1013,21 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_ } /* }}} */ +static zval *sxe_get_value(zval *z TSRMLS_DC) +{ + zval *retval; + + MAKE_STD_ZVAL(retval); + + if (sxe_object_cast(z, retval, IS_STRING, 0 TSRMLS_CC)==FAILURE) { + zend_error(E_ERROR, "Unable to cast node to string"); + } + + retval->refcount = 0; + return retval; +} + + static zend_object_handlers sxe_object_handlers = { ZEND_OBJECTS_STORE_HANDLERS, sxe_property_read, @@ -1020,7 +1035,7 @@ static zend_object_handlers sxe_object_handlers = { sxe_dimension_read, sxe_dimension_write, NULL, - NULL, + sxe_get_value, /* get */ NULL, sxe_property_exists, sxe_property_delete, |