php-src/ext/spl/tests/bug62328.phpt
2012-08-13 11:03:35 +08:00

25 lines
387 B
PHP

--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