3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format($n){ return substr($n, 0, 5)."-".substr($n,5,7)."-".substr($n,12,1); } print format("1234567890123");
Output for 7.3.0 - 7.3.29, 7.4.0 - 7.4.21, 8.0.0 - 8.0.8
12345-6789012-3

preferences:
94.22 ms | 459 KiB | 5 Q