3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 423.13; echo preg_replace_callback("/^(\d)([^\.]+)/", function($m){ return $m[1] . str_repeat(0, strlen($m[2])); }, $string);

preferences:
60.38 ms | 402 KiB | 5 Q