Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10756 invoked from network); 25 Mar 2016 19:48:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2016 19:48:20 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.52 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:33789] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/E4-10214-30695F65 for ; Fri, 25 Mar 2016 14:48:19 -0500 Received: by mail-oi0-f52.google.com with SMTP id d205so107037386oia.0 for ; Fri, 25 Mar 2016 12:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=nd1BaVngiSXFaWbvTGcMRGSOg19Aa9y9COm/lNU/4gQ=; b=qiQW63+jCz0lUN9k7E47a/No6u70Ya6I3lMaLtAAJsQuPq8jUC+zL0kyxv9yQiCX6q h71K69ya+TwccKylmiOYy/MRtzAEhO7Wn6pzYh9b9XvKU7mJST9plf7yEHzzPhYsREX0 SZ+J4LE36hHiFWlhBA5AAKRywz9d5Nd3PsT5MZq8Kt79lg+LxuLIvb8HCqOxF60D90bv ecf233A0qjg+VNSwq6ZVtVSeLmT6VQm5XPIoR3SUlBjZf859KYxSh0eytFzaB3xqo27G YCvF2YSAiQ9EC8bX4iR1eqAt5/AD99fCdYzWtAqPXJPw73RtaAmQgkYrVqOF/kGm7/Ks Cfbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=nd1BaVngiSXFaWbvTGcMRGSOg19Aa9y9COm/lNU/4gQ=; b=VAiWUj6E/Db6/xv/DiFVoWO1ySysGSYcJLepMPAkEyR9VD5SVc8a+TzZamDIUMwXoG AY/oifCA63uaF68ZYykFosFqLzrEqFfVx90oaZVntpqeLetxW+dPJCe/imYAOPm4YVLD o+XmexPxUBUL0aye2R/rWhy7NkaCKngZ2uY11zrYneFh3trYL1wJ9u19a0oqNeucR30r vjL2SsutvvWkqMlDsfUJn7y1Rx6Spc+rXEN5C7Jnn1dFjRokwgmY77dX+hvfebg8frty mtm025yKAYcLHA72Ur2su3y7jkDVpVTbwltT+Rq1CWujBacHH7I2B4W5uEl+YbRV9lkX jgJA== X-Gm-Message-State: AD7BkJJJEsjsiqteJ0Zlrobnfgy4kmMUxuI3pLCJZTz54kj7XsEzE6yQweXhRkOq1JNdiGRERiQUFfZC+KV+fw== MIME-Version: 1.0 X-Received: by 10.157.16.29 with SMTP id h29mr6747425ote.181.1458935296241; Fri, 25 Mar 2016 12:48:16 -0700 (PDT) Received: by 10.157.4.200 with HTTP; Fri, 25 Mar 2016 12:48:16 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Mar 2016 13:48:16 -0600 Message-ID: To: Scott Arciszewski Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary=001a113e5678153528052ee4d89c Subject: Re: [PHP-DEV] Why is 0x7F permitted in PHP identifiers? From: derokorian@gmail.com (Ryan Pallas) --001a113e5678153528052ee4d89c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Mar 25, 2016 at 1:25 PM, Scott Arciszewski wrote: > On Fri, Mar 25, 2016 at 10:20 AM, Andrea Faulds wrote: > > > Hi everyone, > > > > Identifiers in PHP source code (including variables names with $) confo= rm > > to the regex /[_a-zA-Z\x7F-\xFF][_0-9a-zA-Z\x7F-\xFF]*/. Most of this > regex > > is pretty standard: it allows alphanumeric ASCII characters and > > underscores, plus any character with the 8th bit set (presumably to all= ow > > any extension of ASCII, such as Latin-1 or UTF-8, to be used). > > > > But there's one part of this I find rather curious: why is \x7F include= d? > > It's not a high-byte/8-bit character, it's a 7-bit ASCII character, and= a > > control character at that. Unless there's some ASCII extension which > reuses > > that value as a printing character, I assume it must have been a mistak= e > to > > include this character. As a control character, it is invisible and > > difficult to type, and it might do weird things in some terminal > emulators. > > I can't see the value in permitting it within an identifier. > > > > I've done a little bit of looking around, and I can't find an important > > ASCII extension which changes what 0x7F does. Given that, I assume it w= as > > simply a mistake. But one of you might be able to enlighten me otherwis= e. > > > > I've filed a bug report, and made a patch to fix this in php-src and > > php-langspec master: > > > > https://bugs.php.net/bug.php?id=3D71897 > > > > Thanks! > > -- > > Andrea Faulds > > https://ajf.me/ > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > =E2=80=8BInterestingly, extract() skips keys with \x7F: https://3v4l.org/= ZC9ZA\ > Also the keys after the \x7F were not present in HHVM, PHP7, however in 5.5-5.6 you get [9]=3D>string(1) "=7F" along with they key that came after it. That's very strange indeed! > Scott Arciszewski > Chief Development Officer > Paragon Initiative Enterprises =E2=80=8B > --001a113e5678153528052ee4d89c--