3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($input) { $oldMin = 0; $oldMax = 1; $newMin = 127; $newMax = 0; return ceil(((($input- $oldMin) * ($newMax - $newMin)) / ($oldMax - $oldMin)) + $newMin); } foreach (range(0,1,1/1000) as $input) { convert($input); }

preferences:
37.92 ms | 402 KiB | 5 Q