Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91970 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44385 invoked from network); 27 Mar 2016 20:22:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2016 20:22:44 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.179 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.220.179 mail-qk0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:33728] helo=mail-qk0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/37-03797-31148F65 for ; Sun, 27 Mar 2016 15:22:43 -0500 Received: by mail-qk0-f179.google.com with SMTP id s5so87712382qkd.0 for ; Sun, 27 Mar 2016 13:22:43 -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=qgym6A9eM19T9tQS305Xq3WrVpHrzL/vv1yCATt//5o=; b=y3Ftbgb2btxClQxKDHbjH4uOyCdzIOtu0SMydbAhUs++6If6twHVLx4kiFG+5B5dGB bftHx2aqL+9ZpE7glRlaIF9g2Gjomjx0zG3cxhpmjmHo0Z2JwjkvilrEe+MagfBrp5TJ THP4t2b/7vqnYXyEmzPDB9bXymslAEZqjCXaFL4fNGyCBYstDXGry7POQdESnbSAUJKe 4TRPA0/3jA2iPS9LUb0Nr+UGHUqwrRD49jVACgWAGjom3hVfy/CcLb81p4O9XaBiKQbG JEsJ1ljBvo3DElF0JGsWq0Xc5qPb1c0IlkQD5zysgMX9fYqssR91ia497a1oY8yUpY0m DVjg== 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=qgym6A9eM19T9tQS305Xq3WrVpHrzL/vv1yCATt//5o=; b=bXy1CqGuDSRsBw3x+SRIy+/nw22FIQ11/l7JrhyMLytOHfIb9WcMnzJKFqa7ENeBAV H3VEC8VKHEMp8jrWvaSi2B9yfAyXb4F6hl2xTgGDkrpwZRos0jb8r/40i7gNPTfLx0wV YkodgkmPSPEGGlGTNLxmco8JYtiZ5sNyCo8JkE0/W+qzOBYLPbu4fmpeiUqiWDDctmXf ZWS2HlFcy+5OFv7/h6SQgxwijDflc9oNf8ygxKEXkaqASjKHm2iJPZle3HoiP4bTz9hQ 12d4A460KrN4kVRzNSehLnDXac0lWkyGPXZjcmwGnh8YRIklm+bIeZeEKcruXLO9hR6L 343g== X-Gm-Message-State: AD7BkJLIvA2bthjk9NzYCi7j3a5OCVdrU76ynCwNExzVIaLX9WFIaI9SxkyYig37sECgQWvvLr1i6PDFAnlT8Q== MIME-Version: 1.0 X-Received: by 10.129.31.131 with SMTP id f125mr11640155ywf.267.1459110160506; Sun, 27 Mar 2016 13:22:40 -0700 (PDT) Received: by 10.129.148.70 with HTTP; Sun, 27 Mar 2016 13:22:40 -0700 (PDT) In-Reply-To: References: Date: Sun, 27 Mar 2016 22:22:40 +0200 Message-ID: To: Yasuo Ohgaki Cc: Marco Pivetta , Scott Arciszewski , PHP internals Content-Type: multipart/alternative; boundary=001a1141e7f4ce2728052f0d8ec2 Subject: Re: [PHP-DEV] Allow empty property names From: nikita.ppv@gmail.com (Nikita Popov) --001a1141e7f4ce2728052f0d8ec2 Content-Type: text/plain; charset=UTF-8 On Sat, Mar 26, 2016 at 12:17 AM, Yasuo Ohgaki wrote: > On Sat, Mar 26, 2016 at 8:08 AM, Yasuo Ohgaki wrote: > > On Sat, Mar 26, 2016 at 8:00 AM, Marco Pivetta > wrote: > >> On 25 March 2016 at 23:56, Yasuo Ohgaki wrote: > >>> > >>> 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. > >> > >> > >> The sequence "\0*\0" means "protected property", while the sequence > >> "\0Foo\0" means "private property of class Foo": that's been the case > for a > >> looooong time :-) > > > > Oh. Was it? I've never used and encountered this. Thanks. > > I'll avoid null char as I use PostgreSQL JSONB extensively, though. > > > >> Not suggesting allowing "\0" for property names: the example just shows > >> creating a public, private and protected property with an empty name. > > > > Could you show some real world example use cases? > > You mean PHP converts private/protected property to this form, not > currently used as JSON string. > I understand your point! > > It would be good for PHP users supporting null chars in names, then. > As the discussion seems to going off on a tangent I'd like to clarify: I'm only suggesting to remove the restriction on empty property names. The restrictions we have on properties starting with NUL bytes stay intact, as these do serve a purpose with regard to name mangling. To add one further data point, dropping the empty property restriction also fixes this bug about returning an array with an empty key from __debugInfo(): https://bugs.php.net/bug.php?id=69537 Nikita --001a1141e7f4ce2728052f0d8ec2--