1--TEST-- 2Bug #62328 (implementing __toString and a cast to string fails) 3--SKIPIF-- 4<?php if (!extension_loaded("simplexml")) print "skip"; ?> 5--FILE-- 6<?php 7class UberSimpleXML extends SimpleXMLElement { 8 public function __toString() { 9 return 'stringification'; 10 } 11} 12 13$xml = new UberSimpleXML('<xml/>'); 14 15var_dump((string) $xml); 16var_dump($xml->__toString()); 17?> 18--EXPECT-- 19string(15) "stringification" 20string(15) "stringification" 21