summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/bug62328.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/simplexml/tests/bug62328.phpt')
-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"