var_dump(ceil((float) 55));
// float(55)
var_dump(ceil(55.0));
// float(55)
var_dump(ceil(22 / 40 * 100));
// float(56)
Why did the first two examples return 55, while the third example returned 56? Can you explain the difference in behavior?
for more clarity:
22 / 40 * 100 = 55
I have tried this examples with PHP 7.4 and 8.1.
1