Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103295 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60921 invoked from network); 1 Oct 2018 16:17:57 -0000 Received: from unknown (HELO mail-it1-f181.google.com) (209.85.166.181) by pb1.pair.com with SMTP; 1 Oct 2018 16:17:57 -0000 Received: by mail-it1-f181.google.com with SMTP id m9-v6so11083405ita.2 for ; Mon, 01 Oct 2018 05:27:19 -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=xzjhImZbmhN+8Za6x0IYFGVMcphzHlNaWJYu4/hMB8E=; b=VGUCZ4460sTf6jG3kjuGn6/QXcmtzVGFXjf/ghLK2VghbElY1EMnsl1XZA3/Ehf9EI G8rkwmu0YxukJUxRPXAB6mRO6D4ahohnMMJ9P5caZszh5EESryUL01Adom4fp/7BxK4n uSR4T3LCsywMWoMB8u5nZXmWJAG5ylhiZfhlJBTuxIsulPpw9yDPjOC6V+fnZtHYYesc aoYfX9og7CeuFF3M+aluifoR9A0q/Ws62pBi8SKw8BcWBU5fWEU2fa2l6vDAkz20Qo/B qkm2DVQznOcL7iXPQxfcOG42Rsq86JVyw7sGsXzEcGSrXVT6PG/WADVWGZpMmcK1WvM3 Y0Dw== 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=xzjhImZbmhN+8Za6x0IYFGVMcphzHlNaWJYu4/hMB8E=; b=Wlc4tRRnLOp9MJvnBtj2QoCd74S7ekIuGIBJoriEMSmGR8fWHz1i4aamYBRnPPW860 DXAPBu5N5fuicfMUMi5bL3bQX93u7BVPiqQim54bnoiJ6HeKH/2QnxWsuxNHIUp5PGuw us6PP9TQx2eFGWaELZa1NpILeikNIyEjh2vKfkPcDeumTgvqaGPsLcm13DOUfK97O09c jN9fbVd3w64nQhG04WVK7add5l9HcyAz2pYFtiqZdLs2TUOHFg5oqozRgYxlObAgV3XM wv6Q4MFz/8hozkvd623/qBxE8ftLKOpI8gI+elxDVuRwxdyqU1xs2rdcpJrPQwRMoilL SANw== X-Gm-Message-State: ABuFfohzM7G1rpnimEphrojbuSXP7Usqdj+rG6M0RYMDG05q2uNL7NNv EQ1Jzs4lCokU5UCsFdoI6GZLmHzxYBQp6t4GN2s= X-Google-Smtp-Source: ACcGV61XgFSN1k8+NtPUrYYHzV7SAMPWKRWWvSP/i1E4cbu+0+hwOVAd1NcqX1lFCkExpKjQsvFC7e+geaSDtTB/VHw= X-Received: by 2002:a02:29c5:: with SMTP id p188-v6mr7895114jap.110.1538396838987; Mon, 01 Oct 2018 05:27:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Oct 2018 14:27:06 +0200 Message-ID: To: Marcos Passos Cc: Rowan Collins , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000001c8d38057729ed43" Subject: Re: [PHP-DEV] Class name resolution for \array::class From: ocramius@gmail.com (Marco Pivetta) --0000000000001c8d38057729ed43 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable They are still not classes On Mon, 1 Oct 2018, 14:24 Marcos Passos, wrote= : > 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" > to > > 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 > PHP > > 5, "int::class" can plausibly resolve to the name of an actual class, b= ut > > in PHP 7, it can't, but clearly this part of the grammar wasn't updated > to > > 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] > > > --0000000000001c8d38057729ed43--