3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roundUpToNearestThousand($n) { return (int) (1000 * ceil($n/1000)); } var_dump( roundUpToNearestThousand(999), roundUpToNearestThousand(1000.001), roundUpToNearestThousand(1001), roundUpToNearestThousand(1100), roundUpToNearestThousand(1600), roundUpToNearestThousand(100010) );

preferences:
72.25 ms | 405 KiB | 5 Q