xref: /PHP-8.1/ext/simplexml/tests/bug53033.phpt (revision 7f2f0c00)
1--TEST--
2Bug #53033: Mathematical operations convert objects to integers
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8$x = simplexml_load_string('<x>2.5</x>');
9var_dump($x*1);
10// type of other operand is irrelevant
11var_dump($x*1.0);
12
13// strings behave differently
14$y = '2.5';
15var_dump($y*1);
16var_dump((string)$x*1);
17
18?>
19--EXPECT--
20float(2.5)
21float(2.5)
22float(2.5)
23float(2.5)
24