Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:114510
Return-Path: <tysonandre775@hotmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 45687 invoked from network); 18 May 2021 00:37:20 -0000
Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5)
  by pb1.pair.com with SMTP; 18 May 2021 00:37:20 -0000
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id B597E1804B0
	for <internals@lists.php.net>; Mon, 17 May 2021 17:46:42 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,
	FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,
	SPF_PASS autolearn=no autolearn_force=no version=3.4.2
X-Spam-Virus: No
X-Envelope-From: <tysonandre775@hotmail.com>
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2016.outbound.protection.outlook.com [40.92.22.16])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by php-smtp4.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Mon, 17 May 2021 17:46:42 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TQHacWuSTQbqPtZTzxVqFcPF9Cw3IZGINJ1gHKSoua/+qWQMtUTA0GM6vKspr9V2e+Ydr6vVoEfkL8rH/rGEUCkTHUxVrbkm2mKnG9Y5K4//rJTbPEG8XJ8WE2hoMySRN4lrX4gsrDsqF03YexBn/AUEom011Iw2Mgx9WbHl8QTQQksslGOxNNZciU3BfXXHQEafa3TqKOwHuYB8CevJpThI3Fu74HcSZembQ2GCoZGne0bOztTuAXUj5NadmR5Ts+en2OpJbAhjVfPkmCK8AwkgQ6BbZ+XovriPQ9//uXes6mAjNaBzkOkiGixEOso31/G5H9gll3JDuXqShbn1/A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uaDpvgl752M+HNgYL1YwPBydpWuGvw8/p73HoFH2tTg=;
 b=Igjpsj42XaFdveA3Bdwk6sKH8sGlLLT+QpwNJ2096Xx7RglC99CcTRcasQzo7zeqXOvqZAVO+4KV1M/wIwAr8P2TXBkRHIpsDVLigPVanGLpuiwaB+8zOtjiTM1oWUNGyL7pMsNFQ52ZUFZ8E3WuLaOWQFiWlz9DAbGfAUylC42S54xZC/ECvIewpJJ/tzXxGNExjSOLOS7SWKJE5j+YHVU+Edy7bUyR6thGNqLl44iaaDJqusFsrK0SO9Bqk5lkEGdyl4XeOcotT0W0k2ZQC8yGD5tMfhn4S8Ywu/W15Zyfy8FnDQeTWFGfgX3RQ7F2SWL7uLDHOdZxFLR3WgNpBQ==
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=uaDpvgl752M+HNgYL1YwPBydpWuGvw8/p73HoFH2tTg=;
 b=XZudN2wuVu9bEYhCud8SkcdKC6GJIfazGs3Fn3GrsTPhkDNSA0ISul7aYRFTLk+SuUEYWdZ9P2DAaILLI2eGYgEyqHibUOjSYVDoFwJv1W4kXvlNDmFYBdjyqnV9hsnE23vWz52ph4VNomVewRUv6dqvmocHHvPvX01lFl5UUS0FNbOktHNzsWY94hCV8bIAXryj2cK/Fresa8GXvKAg9+6bHLUPjj9IYbNdn5Xi7vDhZqGmegsAI6u6yqWUjHOQizMntpskbxkY5DiiK+IhUJQEl7QO2oETylzKffWgyHBfhzWwUU47gOiGHCb08to19YhzZNYXIfaNSm/BWDmNlA==
Received: from DM6NAM12FT004.eop-nam12.prod.protection.outlook.com
 (2a01:111:e400:fc64::46) by
 DM6NAM12HT127.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc64::176)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.11; Tue, 18 May
 2021 00:46:41 +0000
Received: from DM6PR07MB6618.namprd07.prod.outlook.com
 (2a01:111:e400:fc64::52) by DM6NAM12FT004.mail.protection.outlook.com
 (2a01:111:e400:fc64::154) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.11 via Frontend
 Transport; Tue, 18 May 2021 00:46:41 +0000
Received: from DM6PR07MB6618.namprd07.prod.outlook.com
 ([fe80::20ed:6cd1:4fe2:eea7]) by DM6PR07MB6618.namprd07.prod.outlook.com
 ([fe80::20ed:6cd1:4fe2:eea7%3]) with mapi id 15.20.4129.032; Tue, 18 May 2021
 00:46:41 +0000
To: "internals@lists.php.net" <internals@lists.php.net>
Thread-Topic: [PHP-DEV] [RFC]: Allow static properties in enums
Thread-Index: AQHXSyQDVDy99aZ9kUmonoEBFwdfBarnuCqAgAADjgCAABjeAIAAjcbT
Date: Tue, 18 May 2021 00:46:40 +0000
Message-ID:
 <DM6PR07MB6618C7446A771452DEB9D5DCF92C9@DM6PR07MB6618.namprd07.prod.outlook.com>
References:
 <DM6PR07MB6618AA302ABC6DC7A37B609BF92D9@DM6PR07MB6618.namprd07.prod.outlook.com>
 <CABdc3WpFk9qf10D=fEscB6LynmdN2_yFHW1b_Mz1m837=YOhTg@mail.gmail.com>
 <a8cca9f4-10c2-47ee-a6f9-c27e247d4734@www.fastmail.com>,<CABdc3WrYW9HQZ1D8F001HNCrY-UmFO2Z_+owMAYJk=mxzKjWTA@mail.gmail.com>
In-Reply-To:
 <CABdc3WrYW9HQZ1D8F001HNCrY-UmFO2Z_+owMAYJk=mxzKjWTA@mail.gmail.com>
Accept-Language: en-CA, en-US
Content-Language: en-CA
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-incomingtopheadermarker:
 OriginalChecksum:262F5222C7858620AA3DF3772EC86DE8A8D56220F991183EF9A23C218239EAB5;UpperCasedChecksum:AA2F57EB072A2211BC003F7AD90AAF1BFA101B4CBE46BCB9022648D3D7AD18C8;SizeAsReceived:7267;Count:44
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [3QdjjWjY1TNFu04+Sg3U653VEjr+CIIl/G27skHUPKWNGCq/DCl5aZiYA3XqXI80]
x-ms-publictraffictype: Email
x-incomingheadercount: 44
x-eopattributedmessage: 0
x-ms-office365-filtering-correlation-id: 78551cc4-c935-4cc2-30a9-08d9199666d2
x-ms-traffictypediagnostic: DM6NAM12HT127:
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 qJLElhne5+6bjjBdvuLzbpUHm0fKWpE5bu4vJeWOmTsfMWpOtAvz8JWaoJAAAE/7e6dy+3T8g+W2FgJXExlhQ5NsuvRaY27acHqJLTMiNDwo75/5bedqscXZXgW9r9/PZRLNivr1vVm2PeoVjNLEi2VpfOHULtCyThxk74jBIqRFDSYN9pK3wY20ueIN12CFk6fo4DAhhIgTKOCkkYmAGlpNLkhlOW1zcAuAEQrn2FIjctHSJnsjmbB+ieth5SPC6v+EsRew+K2vFGx/n59+Spjvab+XxleXxD9iHlc1RfRU7OSH/vuEqlo3rkUnk2G55MtyHNu3bkiGxmqonwZi4kRzy8Q24PmNJEmhiAWrVKauJMcsL2bQEoMjJ1/R/7WFE92WH0Bue2hfBe5vGOlfsb8y6VYF5CaoB874Fzo/Hu3AVvyVkChiwxO9QnrIiulRZOYcc4mHcrYvC5T+a8HQfA==
x-ms-exchange-antispam-messagedata:
 WKEetvm9hpnPaM62BVu6SeMmYoLaE+FMXWpYVWIvqHCsZadR+etBShGV6+OmjqvMC77sJ1LCh2QpAuJuo+EioQ/XJdtPfh0hLFcoxfau66jsL/N5hGho5Qq9V7WvTH+SJIEZ9JKZG+jMDLL9UP8Ay1rPoPY0xoeJh4I6VTgroxeJwCj1OxSWV+mCwY7eHiKN2x4UdQ4XSI73PCxI0Xmigw==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT004.eop-nam12.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 78551cc4-c935-4cc2-30a9-08d9199666d2
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2021 00:46:40.9696
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
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: DM6NAM12HT127
Subject: Re: [PHP-DEV] [RFC]: Allow static properties in enums
From: tysonandre775@hotmail.com (tyson andre)

> > On Mon, May 17, 2021, at 9:16 AM, Micha=B3 Marcin Brzuchalski wrote:=0A=
> > > pon., 17 maj 2021, 16:02 u=BFytkownik tyson andre <=0A=
> > tysonandre775@hotmail.com>=0A=
> > > napisa=B3:=0A=
> > >=0A=
> > > > Hi internals,=0A=
> > > >=0A=
> > > > I've created a new RFC=0A=
> > > > https://wiki.php.net/rfc/enum_allow_static_properties=0A=
> > > >=0A=
> > > > Although enums are immutable objects, it is often useful to have=0A=
> > functions=0A=
> > > > or methods that operate on enum instances.=0A=
> > > > In many cases, it would make sense to declare that functionality as=
=0A=
> > static=0A=
> > > > methods on the enum itself.=0A=
> > > > In cases where static methods require shared state, it would be use=
ful=0A=
> > to=0A=
> > > > allow storing those shared state in static properties.=0A=
> > > > To ensure immutability of enum instances, it's only necessary to fo=
rbid=0A=
> > > > instance properties, but all properties were forbidden in the initi=
al=0A=
> > > > functionality included with the enums RFC.=0A=
> > > >=0A=
> > > > This RFC proposes allowing static properties in enums, while=0A=
> > continuing to=0A=
> > > > forbid instance properties.=0A=
> > > >=0A=
> > >=0A=
> > > Would you be able to provide more real life example?=0A=
> > > The example in RFC could easily encapsulate current Environment readi=
ng=0A=
> > in=0A=
> > > for eg. EnvironmentConfiguration class with static property and metho=
d=0A=
> > and=0A=
> > > TBH possibly that would be my preference to solve this.=0A=
> >=0A=
> > I would agree.=A0 Static properties are ugly to begin with.=A0 They're =
globals=0A=
> > with extra syntax.=A0 I have no desire to see them on enums.=0A=
> >=0A=
> > Also a clarification, since it wasn't entirely clear in Tyson's origina=
l=0A=
> > email: Static methods on Enums *are already supported*.=A0 They were in=
cluded=0A=
> > in the original Enum RFC.=A0 The change proposed here is just about sta=
tic=0A=
> > properties.=0A=
> >=0A=
> =0A=
> Personally, I'd prefer to see enums as value objects only, adding static=
=0A=
> properties allow to implementation of statically conditional behaviour.=
=0A=
> IMO enums should consist only of pure functions. This is why I'd vote NO =
on=0A=
> this proposal.=0A=
> =0A=
> Cheers,=0A=
> Micha=B3 Marcin Brzuchalski=0A=
=0A=
Hi internals,=0A=
=0A=
I've updated https://wiki.php.net/rfc/enum_allow_static_properties to inclu=
de the arguments made so far against/for including=0A=
static properties, as well as including more arguments/examples in favor of=
 including static properties in traits.=0A=
=0A=
Thanks,=0A=
- Tyson=0A=