3v4l.org

run code in 300+ PHP versions simultaneously
<?php $factor=6; for($x=0; $x<10; ++$x){ // battery of 10 tests $number=rand(0,100); echo "Number: $number Becomes: "; if($remainder=$number%$factor){ // if not zero $number+=$factor-$remainder; // use cached $remainder instead of calculating again } echo "$number\n"; }

preferences:
24.45 ms | 404 KiB | 5 Q