3v4l.org

run code in 300+ PHP versions simultaneously
<?php $width = 2034; $height = 847; bcscale(5); $fig = (int) str_pad('1', 4, '0'); $ratio = (ceil(bcdiv(bcdiv(1200, bcdiv($width, 100)) , 100) * $fig) / $fig); var_dump($ratio); $newWidth = bcmul($width, $ratio); $newHeight = bcmul($height, $ratio); var_dump($newWidth); var_dump($newHeight);

preferences:
36.4 ms | 402 KiB | 5 Q