Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45738 invoked from network); 5 Nov 2015 14:59:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2015 14:59:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:35772] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/43-24765-7DE6B365 for ; Thu, 05 Nov 2015 09:59:36 -0500 Received: by wicll6 with SMTP id ll6so11807844wic.0 for ; Thu, 05 Nov 2015 06:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=uqg0pratlbT34ESQ0hQyRZxBnZ8JnP1lAVKjKPxLers=; b=IpzERrCocHsTy/1gEwwdVvou9VdLiVgpNpSU25j1d+OEP5yYbZFUR1WFYuzfwyfdIw Xw1qGx9ZSk2fSUCoETXytj8nAGGeBoZbIeW+hII3NiX5A212KDMK16pIsMRHnlKxrBeg fn04NEpCfifKVv9mK8CdMUZO1NiK+XwCtzLqx0xoCbUPNj6QRrGE5oID1RwcJ65KxqmI 09R+3BjLal8FOGdHfBf/uxxQSU6li4hjJp/GfkGffE+p3qe1/EcrfocoTR/6pb6FJo17 ostsY9ELBFVItoBAcpIZawby648az0Z3/H0bf/5bgs+oW8sRo1/9LlzK3Gdllw/xtaNG pS5g== X-Received: by 10.194.116.167 with SMTP id jx7mr9000753wjb.105.1446735572432; Thu, 05 Nov 2015 06:59:32 -0800 (PST) Received: from [192.168.0.5] (cpc83573-brig19-2-0-cust218.3-3.cable.virginm.net. [81.98.228.219]) by smtp.googlemail.com with ESMTPSA id at4sm7425982wjc.9.2015.11.05.06.59.31 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Nov 2015 06:59:31 -0800 (PST) To: internals@lists.php.net References: Message-ID: <563B6ED1.1030601@gmail.com> Date: Thu, 5 Nov 2015 14:59:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Null bytes in anonymous class names From: rowan.collins@gmail.com (Rowan Collins) On 05/11/2015 14:21, Niklas Keller wrote: > Hello, > > I discovered today that anonymous class names contain a null byte right > after "class@anonymous". I don't think class names should contain > non-printable characters. > > How about removing that null byte? > > https://3v4l.org/QUKpV > > https://github.com/php/php-src/blob/da8e6ec4a5063d9f60f83f43c55bc17d015cac8b/Zend/zend_compile.c#L5207 > > Regards, Niklas > PHP uses null bytes quite a lot to produce deliberately illegal identifiers. For instance the old eval-like create_function() [e.g. https://3v4l.org/hqHjh] and the serialization of private members [e.g. https://3v4l.org/R6Y6k] In this case, I guess the "@" in "class@anonymous" makes the name illegal anyway, but I'm not sold on the null byte being more unacceptable here than anywhere else. Regards, -- Rowan Collins [IMSoP]