Joe Watkins wrote on 23/10/2014 09:18:
I'd rather higher level stuff existed at a higher level, I'd rather solve for ustring the problems that are solved for normal strings and leave the rest up to whatever the framework/component/library or wants to do.
It's not really higher level in terms of the problem being solved, it's the same functions applied to a higher abstraction of what "string" means. It doesn't make much sense to say that u($foo)->length "solves the same problem as" strlen($foo), but grapheme_strlen($foo) is somehow "higher level". They're three different definitions of the word "length" which can be applied to the same string, and it would be nice if they were all accessible through the same API.
I get the feeling people are thinking of grapheme functions as something exotic and hard to implement, but ext/intl seems to have a very straight-forward set of functions for them: http://php.net/manual/en/ref.intl.grapheme.php
The two-interfaces idea was just to get over the naming problem of prefixing everything with codePointX or graphemeX, and wouldn't actually require a separate data structure under the hood.
-- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php