3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 100000; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i % 10 === 0; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i & 1; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = (bool) $i & 10; } echo microtime(true) - $t0 . PHP_EOL;

preferences:
39.04 ms | 402 KiB | 5 Q