Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126759 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 0A1701A00BC for ; Fri, 14 Mar 2025 17:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741974183; bh=PU9J2EAkzyXbxq0SMvqBYA07RMMdjVFF1NDw2tbqy3o=; h=Date:Subject:To:References:From:In-Reply-To:From; b=C7WcWYdm8XGFisXI0HpLvqV4Nyh1I3I3EZSJu5uix8FaD5ixDUGqRUigRPT7wKalD UlY+FVcUGLP7dvwPq5otF6x8AI2Asui9rqveOGHfWeF5CCH01brH4exrXAszzrw0ng bhO812jHJ3NxOboOP1iPEeH4j9TgPeEZEP6b7eQv/vCF/W0b3uMHhzuy/8qRqbNQ5V 5vP8jvGY34t1Hgg5Q4XRdrX6obQ3skai3+b5aVEmu2+hSD+Hdc48cm5f+g2gn7Nwmn 440K2nmsA9IvHbaansGdzq3Nn3B5PcGM6rBrc5jvfmwIrSnlLrVwlCx9AYQrq3BVHV SJbYV3i/wNJYQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F1876180034 for ; Fri, 14 Mar 2025 17:43:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2012.outbound.protection.outlook.com [40.92.59.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Mar 2025 17:43:02 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ofgm5pCe5y2kjRSOaZ8UPREqgSDqKLhzE8esp4mzPvlFixS47VFGpjtRU24L7BdGiwBJ0AZJPbMcEoaN+UUUtCJE4K4AVMGdTpYvKflpJ/0qRmgvVq9xNs5om6CyiMfwqruS1A39r9m8SQFF/GeVm0OmABmCRTGaraw97YrEAqCk+03qV2KaZIM2JMyfQU17o6PoSEGmLK6Xia+aPYYt3//G6mPy4HN+Sj7jt7jSly81ByWaJcAMPv6o4jw1uzavKKegTSq+jcv0nd8AMdwYLAmffrsU3XeCNkEQbHptZ+JkmCbUo6HKheT75gVL6iFWuLYnbT/XdbMgz8XcBTwfWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MOU102U+W6J84bwG0SY1Az1CLN316fJqXHUBkTG18Og=; b=wCNMY4GV87mNVPgHLKoyND3l4HirpgNdK3l8zIgRxPEb/TnQ12W6rbDH1r7wVBfj6b5KUlV4OoDF5lm5Kt4chqzpMIy9cug5cGERR1CneC7AF1WWDXfRMKe3f726K79O/v7p5ScY52dsAiRhE2k2HmI4PG+m+9FvMBFPEYEHtAag1VIwvrKB0MjpIqHElkpeWq76ir92HOsWH9yart1bdxzVMkW2Z2gwDg0t+ykV9M0L7AaoJNu1tIwluXH26KhV1SsfuDYyTZZ5FDhnqHRA/glp4BfRSO3Nv9AaNN5DJwn/Wty3E/GpHOGDESsKHMSv1HE7CvmWw096L28LX1lLuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MOU102U+W6J84bwG0SY1Az1CLN316fJqXHUBkTG18Og=; b=RCZtncab/lReUV1QOJg4wa6dmLnLkehbWeiSMQPTI2EiAVuNftFo2w96bdiA4McScpk7hbBk8uRNyfcqLX8Q387aEMsHRnjLPYoF5S39KFqNqdqjgGE4Mq0kpvavj9lwzzNUuklpCxSu2rJimnMpYoSGBATTaDfMU7pDIBNB2DdY2k+jADvUjmZk/mV2DBdG43e32y/bbLVh4c0jjFO4hpclAL5w+1O8LguU3VxNpeUjKchIKwTyJMJzj1JEQfqPpq1fIoQyFTkrMJmBj7s8qQ9QjIZe5HwbO2hN5Zwnu4g96XQfQtg3lCjlTvBz0EpIkZgVFLCEXL6uIGHoeht4gA== Received: from AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) by DU2P250MB0383.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:2b6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.25; Fri, 14 Mar 2025 17:45:31 +0000 Received: from AM8P250MB0170.EURP250.PROD.OUTLOOK.COM ([fe80::651e:bbd2:b18a:80ff]) by AM8P250MB0170.EURP250.PROD.OUTLOOK.COM ([fe80::651e:bbd2:b18a:80ff%3]) with mapi id 15.20.8534.027; Fri, 14 Mar 2025 17:45:30 +0000 Content-Type: multipart/alternative; boundary="------------uoD5UGSrtAFn91vR9zhluIgc" Message-ID: Date: Fri, 14 Mar 2025 18:45:29 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] RFC: short and inner classes To: Ilija Tovilo , PHP internals References: Content-Language: en-US In-Reply-To: X-ClientProxiedBy: FR4P281CA0338.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ea::11) To AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) X-Microsoft-Original-Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8P250MB0170:EE_|DU2P250MB0383:EE_ X-MS-Office365-Filtering-Correlation-Id: 947f00b1-40ae-4f0a-643b-08dd6320035e X-Microsoft-Antispam: BCL:0;ARA:14566002|15080799006|461199028|8022599003|12050799009|19110799003|7092599003|5072599009|8060799006|12121999004|3412199025|19061999003|440099028|41001999003; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NkQ0b3FjWGY1V3ZrV0pmWEZRSTJ1OHVORWxHZGVQUFNuL2RMVytPTit0RmY2?= =?utf-8?B?Y2VWTVcxa0U0S2dJRy90ODcraVpCVmFMR3dFczNwUDhZc1JjTDNDR1B1aXF4?= =?utf-8?B?S3NTUGpjTGdZWDU0bG5INjFjdER5R1pZWjdvWStobjRrdTIrRVlCOE1RcW8w?= =?utf-8?B?Z3NnZ1ZZaUJCT3Y1MExXUFlXUFpIZ2FncldFQ3M0dkRRQ0k1SzZoK1ZDY0tn?= =?utf-8?B?eFlKb2tZczczY0M2RjRIMDByMytnT0QrYWNxTit6am1WWUptZWNJVUlCM0tj?= =?utf-8?B?NUo4dHRlOTVEeE9Nbjd0R1lzNXpSMFI0QmUwa0dWUXJmR3lBbDBRMlpSUm5W?= =?utf-8?B?YjJxWDVJZ1J6SFYwc3pPV3Y1RVRXRmU5WGkwcTJDaHUzblh2bUJxYlZoZVBq?= =?utf-8?B?cVFENi90V3p4ckVtMUJ4ejhtdUdzR21NN3ZvbUFxbjhGRmU2NG9xNEVsTz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U5jaU0zZmVsMVds?= =?utf-8?B?RTZUVlIzZk56MjdTdU9ueUN5cGczVi9pRHhPYlBjaUxFUno1Vy9DemtXQWtX?= =?utf-8?B?WlZWUzJRelNtbWtZa0lUOTlsVHNCUkQvajRFeHJJY0J4KzdrbXFhaEV0ZDBL?= =?utf-8?B?cU5KWTlVV1NzcHBEclFyS0NNVmdqZDJzQXdvc2RaZldhZ3pGdXovSktCc0Y1?= =?utf-8?B?aThLTkhMVS9UY1hyekg2NkNqRHZJV3lJUUEwaC9SYWw4UWFVcTBwbEw4UXMx?= =?utf-8?B?TGZ2dXV0NFJYRVI0dU96Y3VYYlFkajEyOXlleFUyeEt5SzNnSDJkQ2pIRW9y?= =?utf-8?Q?Ei/IvfUOqhD4J0WGDU=3D?= X-OriginatorOrg: sct-15-20-7784-11-msonline-outlook-95b76.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 947f00b1-40ae-4f0a-643b-08dd6320035e X-MS-Exchange-CrossTenant-AuthSource: AM8P250MB0170.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2025 17:45:30.7250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0383 From: bobwei9@hotmail.com (Bob Weinand) --------------uoD5UGSrtAFn91vR9zhluIgc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hey Ilija, On 14.3.2025 17:09:40, Ilija Tovilo wrote: > Hi Bob > > On Thu, Mar 13, 2025 at 11:36 PM Bob Weinand wrote: >> On 6.3.2025 23:20:37, Ilija Tovilo wrote: >> >>> I would also like to echo what has been said about the :: operator, >>> which feels out of place. I understand that \ comes with additional >>> autoloading challenges, namely requiring a fallback autoloading >>> strategy that currently does not conform to PSR-4. >> Could you please elaborate on why the :: operator feels out of place? >> >> \ is a namespace separator. >> >> :: is a class scoping separator. >> >> >> You, yourself did decide to use nested :: for property hook scoping, like parent::$x::set() - a property scoped within a class, having methods. >> The same applies here - it's a class scoped within a class, having methods. >> >> Breaking from these patterns seems very surprising to me. > :: is an operation performed on the class. E.g. fetch a static > property, fetch a constant, call a static method, while \ is part of > the class name. The way I see it, the outer class can simply add an > additional namespace component to the inner class. I'd consider this a very internals perspective. Yes, internally it will include its separator and the reported name includes the separator. From a user perspective, the class is fetched (an operation!) from its defining class. Similarly, static::Foo (if it is going to be re-introduced) and parent::Foo, are definitely *fetches* of the class. And as such, it should also have the :: operator. > class Foo { > class Bar {} // Called Foo\Bar > > public Bar $bar; > } > > This is dead simple, it doesn't change any assumptions about class > names by embedding new symbols, it doesn't need a new operator, you > can refer to the class with its short name from inside the outer class > without `self:>`, which is shorter and more straight forward, `use > Foo\Bar;` will just work in other classes, etc. use Foo\Bar; to reference to an inner-class sounds very much like a bad idea to me. Inner classes are supposed to be intrinsically tied to their containing class, and making it work like a namespace reduces the association a lot. I desire explicitness, which a different symbol can give you. Using namespace-syntax makes the autoloading and human resolution more complex for no gain. Removing the self:: seems enticing, but it breaks at the moment you add inheritance. Then you'll have to either make it a binding-time decision whether it's a namespace access or a parent inner class access. class Foo { class Bar {} } class Baz extends Foo { public Bar $bar; // ??? parent::Bar would be obvious. } Certainly you could opt for only removing self:: in classes they are declared in, but what's then the syntax when referring to an inner class up the inheritance chain? parent\Foo? That's plain weird. Or explicitly requiring the concrete class name the inner class is implemented on? Then this becomes the only weird case which cannot be accessed through the scope resolution. Why would one want that? > One thing this approach breaks is that it doesn't allow for > polymorphic inner class resolution, i.e. static:>Bar. But given this > was removed anyway, that point no longer applies. This can also easily > be replicated by a simple method: > > class Foo { > class Bar {} > > public function createBar(): Bar { > return new Bar(); > } > } > > Except this is actually type-safe, because the return value of > createBar() must stay compatible with Foo\Bar. I don't care much about static resolution for this, but self:: and parent:: are relevant. Bob --------------uoD5UGSrtAFn91vR9zhluIgc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hey Ilija,

On 14.3.2025 17:09:40, Ilija Tovilo wrote:
Hi Bob

On Thu, Mar 13, 2025 at 11:36 PM Bob Weinand <bobwei9@hotmail.com> wrote:
On 6.3.2025 23:20:37, Ilija Tovilo wrote:

I would also like to echo what has been said about the :: operator,
which feels out of place. I understand that \ comes with additional
autoloading challenges, namely requiring a fallback autoloading
strategy that currently does not conform to PSR-4.
Could you please elaborate on why the :: operator feels out of place?

\ is a namespace separator.

:: is a class scoping separator.


You, yourself did decide to use nested :: for property hook scoping, like parent::$x::set() - a property scoped within a class, having methods.
The same applies here - it's a class scoped within a class, having methods.

Breaking from these patterns seems very surprising to me.
:: is an operation performed on the class. E.g. fetch a static
property, fetch a constant, call a static method, while \ is part of
the class name. The way I see it, the outer class can simply add an
additional namespace component to the inner class.

I'd consider this a very internals perspective. Yes, internally it will include its separator and the reported name includes the separator.

From a user perspective, the class is fetched (an operation!) from its defining class.

Similarly, static::Foo (if it is going to be re-introduced) and parent::Foo, are definitely *fetches* of the class.

And as such, it should also have the :: operator.

class Foo {
    class Bar {} // Called Foo\Bar

    public Bar $bar;
}

This is dead simple, it doesn't change any assumptions about class
names by embedding new symbols, it doesn't need a new operator, you
can refer to the class with its short name from inside the outer class
without `self:>`, which is shorter and more straight forward, `use
Foo\Bar;` will just work in other classes, etc.

use Foo\Bar; to reference to an inner-class sounds very much like a bad idea to me.

Inner classes are supposed to be intrinsically tied to their containing class, and making it work like a namespace reduces the association a lot.

I desire explicitness, which a different symbol can give you. Using namespace-syntax makes the autoloading and human resolution more complex for no gain.

Removing the self:: seems enticing, but it breaks at the moment you add inheritance. Then you'll have to either make it a binding-time decision whether it's a namespace access or a parent inner class access.

class Foo { class Bar {} } class Baz extends Foo { public Bar $bar; // ??? parent::Bar would be obvious. }

Certainly you could opt for only removing self:: in classes they are declared in, but what's then the syntax when referring to an inner class up the inheritance chain? parent\Foo? That's plain weird. Or explicitly requiring the concrete class name the inner class is implemented on? Then this becomes the only weird case which cannot be accessed through the scope resolution. Why would one want that?

One thing this approach breaks is that it doesn't allow for
polymorphic inner class resolution, i.e. static:>Bar. But given this
was removed anyway, that point no longer applies. This can also easily
be replicated by a simple method:

class Foo {
    class Bar {}

    public function createBar(): Bar {
        return new Bar();
    }
}

Except this is actually type-safe, because the return value of
createBar() must stay compatible with Foo\Bar.

I don't care much about static resolution for this, but self:: and parent:: are relevant.

Bob

--------------uoD5UGSrtAFn91vR9zhluIgc--