xp-framework/xp-framework — pull request #267 by thekid (2013-03-28 15:42:31+00:00)
Title: String class based on mbstring

This pull request implements option 2 suggested in [this comment](https://github.com/xp-framework/xp-framework/issues/63#issuecomment-15585225) in issue #63 and adds an implementation based on `mbstring` to the `lang.types.String` class *if that extension is loaded*.

The [performance stress test](https://gist.github.com/thekid/5256060#file-test-class-php) shows the following results:

```sh
$ xp Test
0 bytes: 0.379 seconds # only 30 ms slower than original
11 bytes: 0.384 seconds # beats original by 40 ms!
833 bytes: 0.600 seconds # factor 4.5 faster
1406 bytes: 0.700 seconds # factor 8.3!
```

Chosing option 2 doesn't introduce a BC break or new dependencies.