On Fri, Oct 2, 2015 at 4:18 AM, Peter Cowburn <petercowb...@gmail.com>
wrote:

> a) change all other "invalid" escape sequences to be a parse error [that
> would mean "\m" would raise a parse error!]
>
> b) change \u{} to behave like any other escape sequence, by not raising a
> parse error and instead keeping the literal characters
>
> or c) tell me to keep quiet and accept the oddball behaviour, having quirks
> is The PHP Way after all.
>

Well, I think option (a) would break parsed strings containing regex:

$subject = "there are words here";
$pattern = "/\w+/"; // problem
$rc = preg_match_all($pattern, $subject);
echo "Matches: \x1b[7m$rc\x1b[0m\n"; // not a problem

Option (b) sounds reasonable, but there's probably A Solid Reason it was
implemented that way, which if so leaves (c.ii): accepting the odd-ball
behavior....

Reply via email to