From: Xinchen Hui <laruence@php.net>
Date: Mon, 13 Aug 2012 03:03:35 +0000 (+0800)
Subject: more test script for #62328
X-Git-Tag: php-5.4.7RC1~70
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=212cfb95d1c7eb7202e1386294808eceef386b78;p=php

more test script for #62328
---

diff --git a/ext/spl/tests/bug62328.phpt b/ext/spl/tests/bug62328.phpt
new file mode 100644
index 0000000000..33a8aeee95
--- /dev/null
+++ b/ext/spl/tests/bug62328.phpt
@@ -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