3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isMultipleOf(float $number, float $divisor) { $modulus = ($number - round($number / $divisor) * $divisor); $precision = 0.0000000001; if (-$precision < $modulus && $modulus < $precision) { return 0.0; } return $modulus; } function test(float $value, float $multiple, $expected) { if ((isMultipleOf($value, $multiple) == 0.0) !== $expected) { var_dump($value, $multiple, $expected); } } test(400.01, 0.01, true); test(400.01, 3, false); test(9007199254740991.00000000000000, 1, true); test(900719925474099166666.00000000000000, 1, true); test(2.00000000000000, 1, true); test(2, 1, true);
Output for git.master, git.master_jit, rfc.property-hooks

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.64 ms | 405 KiB | 5 Q