3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $width = 2034; $height = 847; bcscale(5); $fig = (int) str_pad('1', 3, '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);
based on a5fmV
Output for 5.3.18 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.2.6
float(0.59) string(7) "1200.06" string(6) "499.73"
Output for 7.0.5
Fatal error: Uncaught Error: Call to undefined function bcscale() in /in/5bEg7:5 Stack trace: #0 {main} thrown in /in/5bEg7 on line 5
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
Fatal error: Call to undefined function bcscale() in /in/5bEg7 on line 5
Process exited with code 255.