1--TEST--
2Implicit string float to int conversions should not warn for literals if float has a fractional part equal to 0
3--FILE--
4<?php
5
6echo 'Bitwise ops:' . \PHP_EOL;
7$var = '1.0'|3;
8var_dump($var);
9$var = '1.0'&3;
10var_dump($var);
11$var = '1.0'^3;
12var_dump($var);
13$var = '1.0' << 3;
14var_dump($var);
15$var = '1.0' >> 3;
16var_dump($var);
17$var = 3 << '1.0';
18var_dump($var);
19$var = 3 >> '1.0';
20var_dump($var);
21
22echo 'Modulo:' . \PHP_EOL;
23$var = '6.0' % 2;
24var_dump($var);
25$var = 9 % '2.0';
26var_dump($var);
27
28/* Float string array keys are never normalized to an integer value */
29/* Strings are handled differently and always warn on non integer keys */
30
31echo 'Function calls:' . \PHP_EOL;
32function foo(int $a) {
33    return $a;
34}
35var_dump(foo('1.0'));
36
37var_dump(chr('60.0'));
38
39echo 'Function returns:' . \PHP_EOL;
40function bar(): int {
41    return '3.0';
42}
43var_dump(bar());
44
45echo 'Typed property assignment:' . \PHP_EOL;
46class Test {
47    public int $a;
48}
49
50$instance = new Test();
51$instance->a = '1.0';
52var_dump($instance->a);
53
54?>
55--EXPECT--
56Bitwise ops:
57int(3)
58int(1)
59int(2)
60int(8)
61int(0)
62int(6)
63int(1)
64Modulo:
65int(0)
66int(1)
67Function calls:
68int(1)
69string(1) "<"
70Function returns:
71int(3)
72Typed property assignment:
73int(1)
74