Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request #73066: mb_at and mb_codepoint_at #2125

Closed
wants to merge 6 commits into from
Closed

Request #73066: mb_at and mb_codepoint_at #2125

wants to merge 6 commits into from

Conversation

masakielastic
Copy link
Contributor

This pull request suggests mb_at and mb_codepoint_at.

string mb_at ( string $string , int $offset [, string $encoding = mb_internal_encoding() ] )
int mb_codepoint_at ( string $string , int $offset [, string $encoding = mb_internal_encoding() ] )

The one of usage of these functions is to iterate over all the chars in string.

$str = "Cat!\u{1f431}";

$gen = (function($str) {
    for ($i = 0, $len = mb_strlen($str); $i < $len; ++$i) {
        yield mb_at($str, $i);
    }
})($str);

foreach ($gen as $char) {
    echo $char, PHP_EOL;
}

@cmb69
Copy link
Member

cmb69 commented Dec 1, 2016

AIUI, these functions could easily be implemented in userland – do we really need to add them to mbstring?

@krakjoe
Copy link
Member

krakjoe commented Jan 7, 2017

@masakielastic can we get some kind of response to the concern raised above please ?

@krakjoe
Copy link
Member

krakjoe commented Mar 1, 2017

Having waited more than a month for feedback and activity on this PR, it would seem abandoned, so I'm closing it.

@krakjoe krakjoe closed this Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants