3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "222\t55555\t9\thello\tbyebye\t444"; $newInt = 2; var_export( preg_replace("/\t[^\t]+\t\K\d+/", $newInt, $string, 1) );

preferences:
89.68 ms | 1255 KiB | 5 Q