mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
7aacc705d0
Closes GH-5958
21 lines
447 B
PHP
21 lines
447 B
PHP
--TEST--
|
|
Bug #62328 (implementing __toString and a cast to string fails)
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
|
--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"
|