Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88642 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46924 invoked from network); 2 Oct 2015 13:53:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2015 13:53:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:35234] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/D9-23989-57C8E065 for ; Fri, 02 Oct 2015 09:53:57 -0400 Received: by wicge5 with SMTP id ge5so34434745wic.0 for ; Fri, 02 Oct 2015 06:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=9rPufavQV+I36+BVDApS9j5Xu1gN4KLVgI3kHwHDJbY=; b=Klxz6T1DGEM2kbdObE/opeuOq9mDzlJHe4p+4boL7HiOyvvBg28Gd9R3dNl3sSDNDW pZyvchpaHiqP3dujc/b9YPE3xXLZ5KRqq45wquXHX+dY9Bzih1JYxhq3WbVUWMHO/b5h VFtGCZmZd18IA1jzJX4jJ2TYnh9M9vsI3kg46tokIa3/vjgHqF1u9N+AyleqM74o3zl/ aER467kXzAfNU0EE4IXfuQZCv8pJQwY4CWMc6Vg6d1serwG9sn2i9gdnU3ugC1yW7RtV PCMZoXdks1gUT090rVfYTE8zepaHKKXhIaJlRWrXd78E6ViBcI82z6xtruikEIGcVaYE PweA== MIME-Version: 1.0 X-Received: by 10.194.82.198 with SMTP id k6mr16165987wjy.139.1443794033905; Fri, 02 Oct 2015 06:53:53 -0700 (PDT) Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.194.110.72 with HTTP; Fri, 2 Oct 2015 06:53:53 -0700 (PDT) In-Reply-To: References: Date: Fri, 2 Oct 2015 09:53:53 -0400 X-Google-Sender-Auth: hTUVpY45BnTDZLMId-g43owcySg Message-ID: To: Peter Cowburn Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7bb0405885181c05211f7e9d Subject: Re: [PHP-DEV] Strings, invalid escape sequences and parse errors From: bishop@php.net (Bishop Bettini) --047d7bb0405885181c05211f7e9d Content-Type: text/plain; charset=UTF-8 On Fri, Oct 2, 2015 at 4:18 AM, Peter Cowburn 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.... --047d7bb0405885181c05211f7e9d--