1--TEST-- 2Bug #62328 (cast_object takes precedence over __toString) 3--CREDITS-- 4leight at gmail dot com 5--FILE-- 6<?php 7 8class SplFileInfo62328 extends SplFileInfo 9{ 10 public function __toString() 11 { 12 return '__toString'; 13 } 14} 15 16$fi = new SplFileInfo62328(__FILE__); 17 18echo (string)$fi . PHP_EOL; 19echo (string)$fi->__toString() . PHP_EOL; 20 21?> 22--EXPECT-- 23__toString 24__toString 25