Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103292 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19473 invoked from network); 1 Oct 2018 12:35:52 -0000 Received: from unknown (HELO mail-it1-f173.google.com) (209.85.166.173) by pb1.pair.com with SMTP; 1 Oct 2018 12:35:52 -0000 Received: by mail-it1-f173.google.com with SMTP id l127-v6so3713033ith.1 for ; Mon, 01 Oct 2018 01:45:12 -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=aHnEa3kaercDWyzv+dhrIjg7nQbSedbBKifTp+Yf8u8=; b=khoQ2QDAQX93sEO0bV33J3wWDerZ1bqfxZVs1BayOMEWKJ/U1hxJFnfkLSmukeJQJn L/IdJlcZIIT/WUSNpnKhNsNJK1xt7iQmcHyzBYug6ILZ8r6zdWfCeG0hJwXoEXNTA5Gd /c+noU3RpXr52Ih0kORjfNoCIo+hwKDIJYov9vkwaqYhZ2vtRZFPA2Y9TXq0mTFlAwZZ pHAKVVgqUOhQMs5LKh32jHt+5b0KiE9Vgnm+FR50AqQgUfjUL6H4JfcqJ1aQf5ySx190 3VJRRyigCPOL/uxeWIuK/QFJiqqZdyVPDe5ifR+P8CkxHv16kiAuU6n2dwUr/g6YLcqn HiMA== 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=aHnEa3kaercDWyzv+dhrIjg7nQbSedbBKifTp+Yf8u8=; b=R/ntlOpG+lH+SkZQLKYQ+o6MhOUtpIpAW4YSynQcKMHQqgDFkVeMPajmfE8HyC7Kpq kx7pyUDk+1vW2s4+iU3sbWpZ80RRODMatZen3f3oRJpRoAqwSkW5W0xS7p9hjzD7lYBC deu0qJyG2FndmVz76srpK8naU88qywmXgdfFDDmUsD71jUk0meaJsLbTs2zEgktY2B1A Pu//qFAwg43EGIono9UTpxUIrONpzsOKdnQJdwrj8tnB6iZEgWEX4X0Pzxi/kmZKWs3V vcQPHBQndK59BR5+4+Y2HOmTcyWqhFwDKTgPavRh4HW37IXIT0reSInsUOIRLjzGibkv aHyw== X-Gm-Message-State: ABuFfojsakmSaiZZTlrTjzQkXR5qh2fpWPWCPUqkBAz4SG0H2YLvoxr1 6/YbuBjIp0q7hklZAwKEpXsbmLVnxb886OpR7bg= X-Google-Smtp-Source: ACcGV639pye8dXLtoCjWvYR12hm5mtCKZ+3cg0/yGQ+RzZ1CuSa75q/hNzkf6+NmETEMAMOl7jKhtzzLiswwMy8TZQo= X-Received: by 2002:a24:1355:: with SMTP id 82-v6mr9930136itz.74.1538383512361; Mon, 01 Oct 2018 01:45:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Oct 2018 09:45:01 +0100 Message-ID: To: marcospassos.com@gmail.com Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000c86007057726d256" Subject: Re: [PHP-DEV] Class name resolution for \array::class From: rowan.collins@gmail.com (Rowan Collins) --000000000000c86007057726d256 Content-Type: text/plain; charset="UTF-8" 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, but 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] --000000000000c86007057726d256--