3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'abcäüö'; $next = 0; while (true) { $aChar = grapheme_extract($s, 1, GRAPHEME_EXTR_COUNT, $next, $next); if ($aChar !== false) { var_dump($aChar); } else { break; } }
Output for 7.3.32 - 7.3.33, 7.4.33, 8.0.13, 8.5.1 - 8.5.3
Fatal error: Uncaught Error: Call to undefined function grapheme_extract() in /in/eO1HV:7 Stack trace: #0 {main} thrown in /in/eO1HV on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0
string(1) "a" string(1) "b" string(1) "c" string(2) "ä" string(2) "ü" string(2) "ö"

preferences:
114.4 ms | 1948 KiB | 4 Q