On Thu, Feb 16, 2017 at 11:25 PM, Nicolas Grekas < nicolas.grekas+...@gmail.com> wrote:
> Actually, there is a very nasty side effect to the "b" prefix: it > complicates using the output from token_get_all. You have to be very > experienced (i.e. have feel the pain really) to know about this rare edge > case - yet it must be dealt with if you want a correct parser in userland. > See e.g. > https://github.com/symfony/symfony/blob/8f65fc7ec1418593d433e39abb71d3 > 959eb10a0b/src/Symfony/Component/HttpKernel/Kernel.php#L718 > in Symfony. > It'd have been great if the future would've been freed from this edge case. > Too bad it has been rejected. > I feel your pain... Dealing with binary string lexing is surprisingly subtle. The linked code is a nice illustration, because it handles the binary string case -- but only for b" and not B", which is also valid. I had the same bug in PHP-Parser until recently :/ Nikita