1--TEST-- 2Implicit string float to int conversions should not warn for variables if float has a fractional part equal to 0 3--FILE-- 4<?php 5 6echo 'Bitwise ops:' . \PHP_EOL; 7 8$float = '1.0'; 9 10$var = $float|3; 11var_dump($var); 12 13$var = $float&3; 14var_dump($var); 15 16$var = $float^3; 17var_dump($var); 18 19$var = $float << 3; 20var_dump($var); 21 22$var = $float >> 3; 23var_dump($var); 24 25$var = $float; 26$var <<= 3; 27var_dump($var); 28 29$var = $float; 30$var >>= 3; 31var_dump($var); 32 33$var = 3 << $float; 34var_dump($var); 35 36$var = 3 >> $float; 37var_dump($var); 38 39echo 'Modulo:' . \PHP_EOL; 40$modFloat = '6.0'; 41$var = $modFloat % 2; 42var_dump($var); 43 44$modFloat = '2.0'; 45$var = 9 % $modFloat; 46var_dump($var); 47 48echo 'Function calls:' . \PHP_EOL; 49function foo(int $a) { 50 return $a; 51} 52var_dump(foo($float)); 53 54$cp = '60.0'; 55var_dump(chr($cp)); 56 57echo 'Function returns:' . \PHP_EOL; 58function bar(): int { 59 $var = '3.0'; 60 return $var; 61} 62var_dump(bar()); 63 64echo 'Typed property assignment:' . \PHP_EOL; 65class Test { 66 public int $a; 67} 68 69$instance = new Test(); 70$instance->a = $float; 71var_dump($instance->a); 72 73?> 74--EXPECT-- 75Bitwise ops: 76int(3) 77int(1) 78int(2) 79int(8) 80int(0) 81int(8) 82int(0) 83int(6) 84int(1) 85Modulo: 86int(0) 87int(1) 88Function calls: 89int(1) 90string(1) "<" 91Function returns: 92int(3) 93Typed property assignment: 94int(1) 95