3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Bbbbbbb Bbb\u{00E4}b\u{00E4} Bbbbb\u{00E4}"; var_dump($str); var_dump(strlen($str)); var_dump(substr($str,0,28)); var_dump(['key' => substr($str,0,28)]);
based on NMG7A
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.26, 7.4.0 - 7.4.13, 8.0.0 - 8.0.2
string(24) "Bbbbbbb Bbbäbä Bbbbbä" int(24) string(24) "Bbbbbbb Bbbäbä Bbbbbä" array(1) { ["key"]=> string(24) "Bbbbbbb Bbbäbä Bbbbbä" }