3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "ABCDEFGHIK"; $num = str_split($text ,3); $cnt = 0; $total = 0; for($b = 0; $b<3; $b++){ $cnt = strlen($num[$b]); $total += $cnt; } echo $cnt; echo "\n"; echo $total;

preferences:
53.77 ms | 402 KiB | 5 Q