xref: /PHP-8.0/ext/simplexml/tests/bug53033.phpt (revision c6c9e71a)
1--TEST--
2Bug #53033: Mathematical operations convert objects to integers
3--SKIPIF--
4<?php if (!extension_loaded('simplexml')) die('skip simplexml extension not loaded'); ?>
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