xref: /PHP-8.4/ext/simplexml/tests/bug54973.phpt (revision 7f2f0c00)
1--TEST--
2Bug #54973: SimpleXML casts integers wrong
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$xml = simplexml_load_string("<xml><number>9223372036854775808</number></xml>");
8
9var_dump($xml->number);
10
11$int = $xml->number / 1024 / 1024 / 1024;
12var_dump($int);
13
14$double = (double) $xml->number / 1024 / 1024 / 1024;
15var_dump($double);
16?>
17--EXPECT--
18object(SimpleXMLElement)#2 (1) {
19  [0]=>
20  string(19) "9223372036854775808"
21}
22float(8589934592)
23float(8589934592)
24