3v4l.org

run code in 300+ PHP versions simultaneously
<?php $px = '1000px'; function get_cm_by_px($px, $dpi = 300, $precision = 2) { $comma = ','; // if US use '.' return number_format(2.54 * (int)$px / $dpi , $precision, $comma,'') ; } var_dump(get_cm_by_px($px));

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
164.31 ms | 2698 KiB | 13 Q