Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116426 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43661 invoked from network); 16 Nov 2021 21:08:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Nov 2021 21:08:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 254E1180510 for ; Tue, 16 Nov 2021 14:03:11 -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.4 required=5.0 tests=BAYES_05,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_H2, 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-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 14:03:10 -0800 (PST) Received: by mail-qk1-f173.google.com with SMTP id de30so509187qkb.0 for ; Tue, 16 Nov 2021 14:03:10 -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=0s1hBkCul0WShaPvxruA7CIM6eHr8/K3r0MfCDPSXgY=; b=qjX6cp92cGn6K4DpPaofcSMkD2Zcv9yymHwd6JRFn0anQLBdfU7MoJ3IZrg9KUUVb4 rSV/S/OTvxD3A9YF1YzpFcxQcaKJxwmRsl/kfJIoQ+4euc+gAke5BSvN7CbnwFtdkgZM TDsP2d8l9PdGqFT7txLhNSbKPKjt0Fo1mGpsLEKVZMtDcAFZz2kayNH8A7GPZn1A3ZTu akh+zqaqjekkb45hLuWWFatk8DMOAbrfFuJZHp1bCJjXkmjaqzcUw+jMDcIzQFEir9V/ 1VFDaLKdhw8vzXOirzcGcjfo/+Fy2G8ZXeFaUzmebiRmyCyC2I7FpVBGkwmMIvImt8bd dIrA== 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=0s1hBkCul0WShaPvxruA7CIM6eHr8/K3r0MfCDPSXgY=; b=xdYEgAd4NE4UByjKUvXNe/Su/s5amUJqgovPGDKf4RZZekRvE0lHRJi9q/QO4EqurJ MyRRvgk01/QgW17IdbfuICBM9JUS+U8kq/VZcnwO4zQgC1GGFh1fDmJ/ojnz+ufSmVcJ kuQW8pOg2FqGcOrBl1QKnw+kHwkASbwJs24u+1jRUZN/4ycvMujuPUyFRow9r4sAYbP3 6ou8JhSyyqeeFBUG1o+pFEPxAETgN5Aon6GmhnazoixC55YphVf/hBTL5t+smoYtJlJb KEooitCfWH1EVaQTHyaHzIqmaijpgMVQukvVO/KLs96UXw7bPpYZxFsSyVoJIF1D2BRL VaQw== X-Gm-Message-State: AOAM533Uq3ri7qyzZluo6rVIP70HkjZUEgah24X4wT+/HMNpblCdhGID iXV7j+qZy+JV7PmatN0g6cKht0pUIQcUVXNxzLE= X-Google-Smtp-Source: ABdhPJxXk14fJhWFZuHE0kgmnezzy3ZquUVkyKz5S6AGOKSY3ckylmBR91s8vupKqi9bQBEe/RoSzC5XfQ77hCbW648= X-Received: by 2002:a05:620a:68a:: with SMTP id f10mr9422979qkh.356.1637100189868; Tue, 16 Nov 2021 14:03:09 -0800 (PST) MIME-Version: 1.0 References: <05aa01d7db0e$783fa120$68bee360$@webkr.de> <05b601d7db18$18d59eb0$4a80dc10$@webkr.de> <968C461B-8CFE-44B3-BED1-5508B1D68B3B@woofle.net> In-Reply-To: <968C461B-8CFE-44B3-BED1-5508B1D68B3B@woofle.net> Date: Tue, 16 Nov 2021 22:02:59 +0000 Message-ID: To: Dusk Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000004764ea05d0ef17e0" Subject: Re: [PHP-DEV] Is there an RFC/discussion for ::class being a specific type? From: tekiela246@gmail.com (Kamil Tekiela) --0000000000004764ea05d0ef17e0 Content-Type: text/plain; charset="UTF-8" Hi Dusk, Perhaps, you misunderstood me. Take a look at the documentation https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class ::class is just a compile time transformation. It will give you the fully qualified name of *something* as a string literal. The only exception to this is when using ::class on objects, as this is a runtime transformation, and when using with keyword static. When ::class is used with a class name, it will give you the name of that class as a string. When used with a name of a function, it will give you the name of that function as a string. When used with a string, it will give you that string as a string. See this example https://3v4l.org/EKnEd The fact that this gives you a callable is just coincidental with all strings being callable in PHP. The reason why it works right now is because a string can represent a name of a class, interface, trait or function. If we were to replace the transformation with something else, like it is proposed here, we would have to ensure that it is as versatile as a plain string. Otherwise we would be losing functionality. --0000000000004764ea05d0ef17e0--