php-src/ext/xml/tests/bug62328.phpt
Xinchen Hui 7b307fb930 Fixed bug #62328 (implementing __toString and a cast to string fails)
__toString should has a high priority
2012-08-12 11:50:28 +08:00

22 lines
422 B
PHP

--TEST--
Bug #62328 (implementing __toString and a cast to string fails)
--SKIPIF--
<?php
require_once("skipif.inc");
?>
--FILE--
<?php
class UberSimpleXML extends SimpleXMLElement {
public function __toString() {
return 'stringification';
}
}
$xml = new UberSimpleXML('<xml/>');
var_dump((string) $xml);
var_dump($xml->__toString());
--EXPECT--
string(15) "stringification"
string(15) "stringification"