summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorFerenc Kovacs <tyrael@php.net>2014-08-24 00:09:00 +0200
committerFerenc Kovacs <tyrael@php.net>2014-08-24 00:09:00 +0200
commita90d05a4304a2ef832afe059dc19c7f14ca86f58 (patch)
treec51c8488d1f5d763c9aa51aa85132ab7f31c2109 /ext/simplexml
parentc4fb183b9fd6fecf7dfb8df309bfa34ff1ec2e53 (diff)
parentcb41a7bad1350f1c9bd162abf52eea128a395e0a (diff)
downloadphp-git-a90d05a4304a2ef832afe059dc19c7f14ca86f58.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: this test depends on the simplexml ext, not just on xml
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/tests/bug62328.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/simplexml/tests/bug62328.phpt b/ext/simplexml/tests/bug62328.phpt
new file mode 100644
index 0000000000..a6e60e488c
--- /dev/null
+++ b/ext/simplexml/tests/bug62328.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #62328 (implementing __toString and a cast to string fails)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+class UberSimpleXML extends SimpleXMLElement {
+ public function __toString() {
+ return 'stringification';
+ }
+}
+
+$xml = new UberSimpleXML('<xml/>');
+
+var_dump((string) $xml);
+var_dump($xml->__toString());
+--EXPECT--
+string(15) "stringification"
+string(15) "stringification"