summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests
diff options
context:
space:
mode:
authorThijs Kinkhorst <thijs@debian.org>2014-10-15 13:17:14 +0000
committerThijs Kinkhorst <thijs@debian.org>2014-10-15 13:17:14 +0000
commit04b664c46aafc46bb3030d3bf06eb5f0b38c2b49 (patch)
tree07e2dbf984b126837bfc6c20e0a025c754ade299 /ext/simplexml/tests
parentd73ee84cfbc86e793602b826adb0dd6bce042838 (diff)
downloadphp-04b664c46aafc46bb3030d3bf06eb5f0b38c2b49.tar.gz
Imported Upstream version 5.6.1+dfsgupstream/5.6.1+dfsg
Diffstat (limited to 'ext/simplexml/tests')
-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 000000000..a6e60e488
--- /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"