3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hyphenate($str) { return implode("-", str_split($str, 3)); } echo hyphenate("ABCDEF");
Output for 7.3.0 - 7.3.29, 7.4.0 - 7.4.21, 8.0.0 - 8.0.8
ABC-DEF

preferences:
131.83 ms | 532 KiB | 17 Q