3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1XYZ"; $int = 1; $start_int = (int) $string; $start_str = str_replace($start_int, "", $string); $result = $int+$start_int . $start_str; echo $result;

preferences:
110.42 ms | 1404 KiB | 5 Q