summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-08-12 11:50:28 +0800
committerXinchen Hui <laruence@php.net>2012-08-12 11:50:28 +0800
commit7b307fb930e6cf328993dee4b060f6f823c39d24 (patch)
tree1810b514ba3f2aa08d135ed6d2a51674d5d98fc7 /ext
parentd4f9bbfae248687c1aa68370564b14544eb4eafd (diff)
downloadphp-git-7b307fb930e6cf328993dee4b060f6f823c39d24.tar.gz
Fixed bug #62328 (implementing __toString and a cast to string fails)
__toString should has a high priority
Diffstat (limited to 'ext')
-rw-r--r--ext/xml/tests/bug62328.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/xml/tests/bug62328.phpt b/ext/xml/tests/bug62328.phpt
new file mode 100644
index 0000000000..e4c3c59d37
--- /dev/null
+++ b/ext/xml/tests/bug62328.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #62328 (implementing __toString and a cast to string fails)
+--SKIPIF--
+<?php
+require_once("skipif.inc");
+?>
+--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"