3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function format_val($value){ if(strrpos($value, ',') !== false) $value = str_replace(',', '.', $value); $value = (float) $value; return $value; } echo format_val('1200.30'); ?>
based on COG0g
Output for 4.3.0 - 7.2.0
1200.3