]> granicus.if.org Git - php/commitdiff
more test script for #62328
authorXinchen Hui <laruence@php.net>
Mon, 13 Aug 2012 03:03:35 +0000 (11:03 +0800)
committerXinchen Hui <laruence@php.net>
Mon, 13 Aug 2012 03:03:35 +0000 (11:03 +0800)
ext/spl/tests/bug62328.phpt [new file with mode: 0644]

diff --git a/ext/spl/tests/bug62328.phpt b/ext/spl/tests/bug62328.phpt
new file mode 100644 (file)
index 0000000..33a8aee
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug #62328 (cast_object takes precedence over __toString)
+--CREDITS--
+leight at gmail dot com
+--FILE--
+<?php
+
+class SplFileInfo62328 extends SplFileInfo
+{
+    public function __toString()
+    {
+        return '__toString';
+    }
+}
+
+$fi = new SplFileInfo62328(__FILE__);
+
+echo (string)$fi . PHP_EOL;
+echo (string)$fi->__toString() . PHP_EOL;
+
+?>
+--EXPECT--
+__toString
+__toString