1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/simplexml/tests/bug54973.phpt
2025-08-06 13:20:28 +01:00

24 lines
456 B
PHP

--TEST--
Bug #54973: SimpleXML casts integers wrong
--EXTENSIONS--
simplexml
--FILE--
<?php
$xml = simplexml_load_string("<xml><number>9223372036854775808</number></xml>");
var_dump($xml->number);
$int = $xml->number / 1024 / 1024 / 1024;
var_dump($int);
$float = (float) $xml->number / 1024 / 1024 / 1024;
var_dump($float);
?>
--EXPECT--
object(SimpleXMLElement)#2 (1) {
[0]=>
string(19) "9223372036854775808"
}
float(8589934592)
float(8589934592)