From: Marcus Boerger Date: Tue, 22 Jan 2008 20:40:30 +0000 (+0000) Subject: - Bugfix #37076 (SimpleXML ignores .=). (felipe, marcus) X-Git-Tag: RELEASE_2_0_0a1~812 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f1540e162bf336b6304725537b18e4e303ac9d2;p=php - Bugfix #37076 (SimpleXML ignores .=). (felipe, marcus) --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5895460ef6..1c65a72fe6 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -719,11 +719,13 @@ static zval** sxe_property_get_adr(zval *object, zval *member TSRMLS_DC) /* {{{ name = Z_STRVAL_P(member); node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC); - if (!node) { - sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); - type = SXE_ITER_NONE; - name = NULL; + if (node) { + return NULL; } + sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); + type = SXE_ITER_NONE; + name = NULL; + MAKE_STD_ZVAL(return_value); _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC); diff --git a/ext/simplexml/tests/bug37076.phpt b/ext/simplexml/tests/bug37076.phpt new file mode 100644 index 0000000000..a5b3801ccb --- /dev/null +++ b/ext/simplexml/tests/bug37076.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #37076 (SimpleXML ignores .=) +--FILE-- +"); +$xml->foo = "foo"; +$xml->foo .= "bar"; +print $xml->asXML(); +?> +===DONE=== +--EXPECT-- + +foobar +===DONE===