Just submitted a small patch here: https://github.com/php/php-src/pull/34
I had sent this before to gr...@php.net, before the GIT migration. Small fix really. The current code is correct, but if it is used inside a long loop or long strings, it's inefficient.