Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23663 invoked from network); 25 Mar 2016 22:57:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2016 22:57:42 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.52 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.213.52 mail-vk0-f52.google.com Received: from [209.85.213.52] ([209.85.213.52:33736] helo=mail-vk0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/A6-10214-562C5F65 for ; Fri, 25 Mar 2016 17:57:42 -0500 Received: by mail-vk0-f52.google.com with SMTP id k1so103861110vkb.0 for ; Fri, 25 Mar 2016 15:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nEUg+CNjhr4ImT3DCilyZwzpJrUyeof1T8RRxig8/gM=; b=hPzotuJiMZc17QT+azBXZ8ckJhweyLZeXE+fKZ0dnz1mqWx6XDNU0mpmAXZxhGkSUa TGbrvzshQIIhmfT0kXwiXodDsGnHOS2z1twBVo1rPshmZsrsDL5473LncVAEg3sNhXwO HNjSdubzbSrVMdnnxihJsJiJgnsnbaMF9uJqjunU74hacOaRZl+wUgi5tAWLghXclNfG YXJVVSf/nH0eiAolkDVX5JX7nwWjKCEAIYLySvyh4LZDuvP127kg8sYaLvyKaNzNz7yH J96So2ZhmBnX/yq8zUdw+KpKjA121Fd5nRsv361xPmJl0Be+Y+xxaftEjFQixsU0LpsF 7pEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nEUg+CNjhr4ImT3DCilyZwzpJrUyeof1T8RRxig8/gM=; b=kMQChiBKuTU3L2ZSUeUz6tkv5O+jhJ+QtWYYz55Db1pfz/hIq4E+0kWUvSnxt1onJo psByHFBaWaynhAPoMMwFl12ot5QX0+xMzDhOnNDR0F6bgXKR1F6ccpnn98pYSGvHeqyo V07f9yTF7xOd4XN0j1RKz+O3B9bWpQzISJUS0fMirIegyKu+C0fEMjnrd2DmPlaRkm19 c5HA/lpA4cdmDacjutejpyQoSK4yr3FR3WK5+LMSBrhTVc1B5xLMzzfcMmPcULG2qBWj k5oQOywq83mUGhdH6IBbegVm3qBkfRl4aCKwAHVEzw56ESG0OPya8q154+HpptDM61PF MbQQ== X-Gm-Message-State: AD7BkJLMxS5zWMXqMepvmHohGMng8L5BitYRuFOd3Q9V4osVey8+3YnGEXqGP3Fs1jODjG5hB8SXWT0Pmzvp4g== X-Received: by 10.176.5.135 with SMTP id e7mr8772739uae.91.1458946658676; Fri, 25 Mar 2016 15:57:38 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.159.40.98 with HTTP; Fri, 25 Mar 2016 15:56:59 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Mar 2016 07:56:59 +0900 X-Google-Sender-Auth: bYHi_3Sy8wjzdta3-i0MWdCJcwk Message-ID: To: Marco Pivetta Cc: Scott Arciszewski , Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Allow empty property names From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi all, On Sat, Mar 26, 2016 at 5:31 AM, Marco Pivetta wrote: > var_dump((object) ['' => 'foo']); > var_dump((object) ["\0*\0" => 'foo']); > var_dump((object) ["\0Foo\0" => 'foo']); Allowing null char would be too much. We reject null char in path parameters, it should be rejected like path parameter. IMHO. Postgresql decided not to allow null char as valid unicode string in JSONB, for example. http://www.postgresql.org/docs/9.4/static/datatype-json.html The jsonb type also rejects \u0000 (because that cannot be represented in PostgreSQL's text type) Postgresql has it own reason why null char cannot be supported. PHP may suppport it., but I'm 30/70 for supporting null char in property name because I cannot think of any use cases other than attacking applications. (BTW, null char in data should be supported as it is now) Array key supports binary strings. If there is vote for this change, I would refrain from voting. php > var_dump(["abc\0xyz"=>1234]); php shell code:1: array(1) { 'abc\0xyz' => int(1234) } var_dump($o->{'123Foo'}); works. ($o->123Foo is illegal) Therefore, +1 for making $o->{''} to work and removing automatic '' -> '_empty_' conversion. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net