tagua-vm / parser

Safe, fast and memory efficient PHP parser (lexical and syntactic analysers, and the Abstract Syntax Tree)
http://tagua.io/
119 stars 15 forks source link

Incomplete binary string handling #43

Closed nikic closed 8 years ago

nikic commented 8 years ago

Single quoted string current only handle b, but not B: https://github.com/tagua-vm/parser/blob/master/source/rules/literals.rs#L217

Additionally, b/B is not handled for nowdoc strings, which also support it.

Hywan commented 8 years ago

@nikic Please, can you provide an example of a nowdoc srings with b or B?

msjyoo commented 8 years ago

@Hywan Something like this?

<?php

$str = b<<<EOD
hello\r\n
EOD;

var_dump($str);
Hywan commented 8 years ago

Fixed in #47. Waiting for the CI before the merge.

nikic commented 8 years ago

Spec fix in https://github.com/php/php-langspec/commit/39cb8bede53e51929700fd2fae66ae3790306d7b.

Hywan commented 8 years ago

:+1: