Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91952 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8172 invoked from network); 25 Mar 2016 19:25:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2016 19:25:44 -0000 Authentication-Results: pb1.pair.com header.from=scott@paragonie.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=scott@paragonie.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain paragonie.com designates 209.85.218.44 as permitted sender) X-PHP-List-Original-Sender: scott@paragonie.com X-Host-Fingerprint: 209.85.218.44 mail-oi0-f44.google.com Received: from [209.85.218.44] ([209.85.218.44:32975] helo=mail-oi0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/64-10214-7B095F65 for ; Fri, 25 Mar 2016 14:25:43 -0500 Received: by mail-oi0-f44.google.com with SMTP id d205so106529570oia.0 for ; Fri, 25 Mar 2016 12:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragonie-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=WZNA8QGamT2PRjXS1LhxcgT2WoOmp59U1item7pxouM=; b=U/moL7WIckMTpLUtVtxsJfAqrTyi7/TOYv85MMi2KU152OJwx9UZpk9zgqCfsz5rcj I0WTpYqSpjDYWNces5Ok+Lq2VtsGD+kRel9DGo+4FuOhEquBiXp3NirOU6VOdFkcaIrd othomyTkTpGFLHkj95Waj2Ur1cKfKdbuFLuDCiQygNs431mi+q97qGED7R3EFDbdo0Px oI5ny/35vACvLyq8n2eNi7h1JDrvTIJMLtlk7aKqvnTV9CxCfayBkyz+5JWZsdU8EquF smoyfFNPAiWwrjXY0V0CNByxJG++ak1NEyzwx6gmiRaq1MsXJEDOdZjfpTNkbLHvev/y hRyA== 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=WZNA8QGamT2PRjXS1LhxcgT2WoOmp59U1item7pxouM=; b=C542TwB6sLiTtMogsJtahl32Q26OZOG7pWnV5vPIOoClMS9mQxI0dgdsr5U2QOuMPF 3uu5zjvbtfYameHXVVcFzBJNkOF368wOkbLPf5WQ7xsTiMIPQvVvK30GSa/hQKE4LaNM OWeJ/OfzTsXTzC1aE/jLILVVP8ZQWQy6U0xcDfsAvgb2hPj5AgbKIRfk2irEIT4y4jXe QEmuIaa8UUlLXxiG+iPdilp22KH37Q8/bV2EhZgSOTRg6qudb1h7ShtjebstN28jQwjZ lb/CtCquvGeiekGbI8o4Ea/+3T9AIO5oOf3ZgVdPiXukmISWvSuRlNCJVlWduw3K8BSn WEqQ== X-Gm-Message-State: AD7BkJLWECAeR2VAsYMvDfz1XA05GNLRsT/agvesbIS3qivUr8h8oshryugYNZAeL+O6NB6Uj7hFoOMUSSzmVg== MIME-Version: 1.0 X-Received: by 10.202.168.200 with SMTP id r191mr6018165oie.40.1458933940844; Fri, 25 Mar 2016 12:25:40 -0700 (PDT) Received: by 10.157.14.42 with HTTP; Fri, 25 Mar 2016 12:25:40 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Mar 2016 15:25:40 -0400 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a113cd4164b99fe052ee4873a Subject: Re: [PHP-DEV] Why is 0x7F permitted in PHP identifiers? From: scott@paragonie.com (Scott Arciszewski) --001a113cd4164b99fe052ee4873a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Mar 25, 2016 at 10:20 AM, Andrea Faulds wrote: > Hi everyone, > > Identifiers in PHP source code (including variables names with $) conform > to the regex /[_a-zA-Z\x7F-\xFF][_0-9a-zA-Z\x7F-\xFF]*/. Most of this reg= ex > is pretty standard: it allows alphanumeric ASCII characters and > underscores, plus any character with the 8th bit set (presumably to allow > 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 included? > 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 reus= es > that value as a printing character, I assume it must have been a mistake = to > include this character. As a control character, it is invisible and > difficult to type, and it might do weird things in some terminal emulator= s. > 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 was > simply a mistake. But one of you might be able to enlighten me otherwise. > > 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/ZC= 9ZA Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises =E2=80=8B --001a113cd4164b99fe052ee4873a--