3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Expecting int(6) [3 times] var_dump(grapheme_strrpos('dejaaaa', 'a', 2)); // int(6) var_dump(grapheme_strrpos('déjàààà', 'à', 2)); // int(6) var_dump(grapheme_strripos('DÉJÀÀÀÀ', 'à', 2)); // int(6) // Expecting int(5) [3 times] var_dump(grapheme_strrpos('dejaaaa', 'a', -2)); // int(5) var_dump(grapheme_strrpos('déjàààà', 'à', -2)); // int(6) var_dump(grapheme_strripos('DÉJÀÀÀÀ', 'à', -2)); // int(6) // Expecting int(5) [3 times] var_dump(mb_strrpos('dejaaaa', 'a', -2)); // int(5) var_dump(mb_strrpos('déjàààà', 'à', -2)); // int(5) var_dump(mb_strripos('DÉJÀÀÀÀ', 'à', -2)); // int(5)
based on nDBKb
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.2.6
int(6) int(6) int(6) int(5) int(6) int(6) int(5) int(5) int(5)