mirror of
https://github.com/php/php-src.git
synced 2024-10-02 15:26:06 +00:00
7b307fb930
__toString should has a high priority
22 lines
422 B
PHP
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"
|