com php-src: more test script for #62328: ext/spl/tests/bug62328.phpt
| From: | Xinchen Hui | Date: | Mon, 13 Aug 2012 03:03:35 +0000 |
| Subject: | com php-src: more test script for #62328: ext/spl/tests/bug62328.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69814@lists.php.net to get a copy of this message | ||
Commit: 212cfb95d1c7eb7202e1386294808eceef386b78
Author: Xinchen Hui <laruence@php.net> Mon, 13 Aug 2012 11:03:35 +0800
Parents: be818e7ea7a7627ab12faa70d9e70a85c823f738
Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=212cfb95d1c7eb7202e1386294808eceef386b78
Log:
more test script for #62328
Bugs:
https://bugs.php.net/62328
Changed paths:
A ext/spl/tests/bug62328.phpt
Diff:
diff --git a/ext/spl/tests/bug62328.phpt b/ext/spl/tests/bug62328.phpt
new file mode 100644
index 0000000..33a8aee
--- /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