Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116421 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23305 invoked from network); 16 Nov 2021 16:39:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Nov 2021 16:39:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3FA8C1804FF for ; Tue, 16 Nov 2021 09:34:26 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 16 Nov 2021 09:34:25 -0800 (PST) Received: by mail-qt1-f180.google.com with SMTP id 8so10079504qtx.5 for ; Tue, 16 Nov 2021 09:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eLIB90ASCf2VVJU/oWkMr+kck4GixxzFXRxJobT+26Q=; b=bpYHVfYPqT7Ty8WRsiKO4Z5kQyOGWRwgVl70rjH/1IXiL2m6oEWim66s4YDUlbUr8U 9PUB8twe/585eiXq1urcVWUzFdrKIjYqsVEdnM6ln+VmghEf+2ONi1W6+r6tSk0r+URD cnPsWnEGq+Fj+6OR9gOW6fPCKlEHPaMTHrzS44H/M1qUGN6amHXhX2iCuftYjyBsWvG4 HuYCp9PvLv9KRxt3RHVRJhCwO2dKxiu9WDJnqjfswWI7/5ED64W2lCQ/4TzUEHRc8r4l gpAMeJPDFlRoBb4GIOPWbkOlQQ4o3dsyPmqxsr36pOhuHRBY/U01L+ZZuLzplHbw/2AH HrcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eLIB90ASCf2VVJU/oWkMr+kck4GixxzFXRxJobT+26Q=; b=XUzbn1Icq55T3f4D+rRn6YiN/A1C8mFD25RUr3woAenFWJOJdBS68q2ore9wjt9qq9 Ug44T9BgBskGox0u4jYcchLP3pqCN5aCykczYyKAkf73HbQLqMBroBZ8i6Ov5iptkz8m U9aeEyKTFLFn1MVAoeNaEY9ZZEtvtEtfpywkvz+eZpywyQDUy8AK4DtzY/qDmEFbIJUR jCdrucciejhsZ5O3n4w6P1y2QuEKfEFHndnXxIf1BEYJ7Pj7GStdEEkZx25E2rWDsDo5 4/Xd65VwXlS9+9pgoq/UBA/DIdPckmTsC6dgqoi7Gsg8usgHCiXHhvyxt+NMvVdlvgi8 099Q== X-Gm-Message-State: AOAM533jUI9I4mTOFc5Fp2KwNfAhHWGAkBVP+l8NGilU6Lvf1NFf5SAz vAHVpDlLiCEAqHa46THVCLM6ATaGAhNC7/XHI9WZzB8LwOXK7w== X-Google-Smtp-Source: ABdhPJz1sufbA3BkB5X1pLYNliB3Gw+wjLAMiCSI5pgh5jCH0IE0IS3Ims7Dc4JGU/Ry6snMBKPCBnyNY/nFOAzB7FM= X-Received: by 2002:a05:622a:3d3:: with SMTP id k19mr9561930qtx.334.1637084065104; Tue, 16 Nov 2021 09:34:25 -0800 (PST) MIME-Version: 1.0 References: <05aa01d7db0e$783fa120$68bee360$@webkr.de> In-Reply-To: <05aa01d7db0e$783fa120$68bee360$@webkr.de> Date: Tue, 16 Nov 2021 17:34:14 +0000 Message-ID: To: =?UTF-8?B?QW5kcsOpIEjDpG5zZWw=?= Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000002b06f205d0eb5673" Subject: Re: [PHP-DEV] Is there an RFC/discussion for ::class being a specific type? From: tekiela246@gmail.com (Kamil Tekiela) --0000000000002b06f205d0eb5673 Content-Type: text/plain; charset="UTF-8" Interesting, but what would such a type actually be? How would PHP check the type? What would be the rules? At the moment, ::class is just a preprocessor macro. It is not part of the runtime. It also doesn't mean the name of the class. It just means "textual representation of the value on the left". For example, this is valid: echo "string"::class; You can use ::class on almost anything that the compiler would treat as a string literal. In the end, it will be compiled down to a string. It is handy to think of ::class as ::text or ::name. I don't think we could enforce class type without actually asking PHP to check if class exists. You can use static analysers for this (see class-string), but I doubt it will be possible in PHP. --0000000000002b06f205d0eb5673--