Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103294 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59265 invoked from network); 1 Oct 2018 16:14:45 -0000 Received: from unknown (HELO mail-oi1-f182.google.com) (209.85.167.182) by pb1.pair.com with SMTP; 1 Oct 2018 16:14:45 -0000 Received: by mail-oi1-f182.google.com with SMTP id p125-v6so10970120oic.3 for ; Mon, 01 Oct 2018 05:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ky5WAoCrsM9EyEjyEHSlY/bHtwvpWzvN0qwVtYgUC9Y=; b=bleSHkhMKo7uxUBeI4aHlLKtA7lQjps8058SsDh4VOtawmD/BAkYRadbSsqwmQ82iB MyPCfMic8cMhNmP3PuYU8YndcNx0V7iAwc2UjABx0Ta4vl++O+V3Z434j6NuvyzYwcG2 s27aTCYFhpVC3LzP5k2nK8NXrUuzAIvZaoaB2B+PInc+aDLwkrE5G4gDUtEI7kzqovqx RdCxiGgqHh4wRHCpqx+1XBgTvQALtaUH10dy9cBkY1cH8bkIJwDlPfieMgNi2mvdhU3O 4M22n4Zc7ObzUI9Tp70RSKN6juB2U4Qvk89GTEDB3JywNozdr4o9gp/eiV7y240XGsac G9Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ky5WAoCrsM9EyEjyEHSlY/bHtwvpWzvN0qwVtYgUC9Y=; b=EjZac9+N0GrAPcznZuJPIeVUvEdcb22l0/HXNC6HSZwQCN9MX15RWvzHOZ2TW7z0Iz VTKoheNQZArSLHTj0hkTMNWYsKleHt/2xw8ufTBoBYba9vUrIKJV0E7dTfpYamaPIDq+ s5Yll18L2uXQJYXdFrabLPBSG10iXEMbpTZLGr9eXzxlKuPUmOOchq4hRgRP65+MDoR2 w4kWAodZcxxOpjuYPlb7jGOpvBEr08HnPOReMPVjclTdWBuKk0mzJYNKnYJLkz8tvo6t GttQLbO6qdBXQiNEBNCddCgIz3icoHUZ8ZKC0TtVa9sjEwbmtulDosc5L16qSIADXzkP pYcA== X-Gm-Message-State: ABuFfohUzV7oWlQfksvuzOjeFFPa9WvMfy6bwLp9EZu157Hjum/icQLD qrzOVB0ExKfksHIKkxDpJMD8xCs/T+kYMRbjzoQ= X-Google-Smtp-Source: ACcGV60g+d8RSg3HDprkYoXXuis0mytrFXxh4pE7V7WW4VV0jbQZEz1wd5BrpUf7vVss0mo6H0HgCzaCT64wr/ed0s8= X-Received: by 2002:aca:470f:: with SMTP id u15-v6mr528308oia.259.1538396646530; Mon, 01 Oct 2018 05:24:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Oct 2018 09:23:55 -0300 Message-ID: To: rowan.collins@gmail.com Cc: internals Content-Type: multipart/alternative; boundary="000000000000a3e143057729e186" Subject: Re: [PHP-DEV] Class name resolution for \array::class From: marcospassos.com@gmail.com (Marcos Passos) --000000000000a3e143057729e186 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Rowan, thank you for sharing your thoughts. You can also see it as a language construct that expects a type at the left-hand side of the name resolution operator. In that sense, primitive types are perfectly valid. Regards, Marcos Em seg, 1 de out de 2018 =C3=A0s 05:45, Rowan Collins escreveu: > On Mon, 1 Oct 2018 at 00:30, Marcos Passos > wrote: > >> Currently, class name resolution supports all types except an array. >> https://3v4l.org/OXFMW >> > > It seems to me that the bug is allowing an expression like "int::class" t= o > resolve, when "int" is no longer a legal class name. > > I suspect the reason "array::class" doesn't work is that it was already a > reserved word in PHP 5, whereas other types were legal class names. In PH= P > 5, "int::class" can plausibly resolve to the name of an actual class, but > in PHP 7, it can't, but clearly this part of the grammar wasn't updated t= o > reflect that. > > The parser is being too forgiving here, I think, and should complain if > the word before :: is not a valid class name. > > Regards, > -- > Rowan Collins > [IMSoP] > --000000000000a3e143057729e186--