Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116073 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4501 invoked from network); 17 Sep 2021 13:14:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Sep 2021 13:14:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B4FFD1804B3 for ; Fri, 17 Sep 2021 06:54:55 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2, 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-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2021.outbound.protection.outlook.com [40.92.23.21]) (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 ; Fri, 17 Sep 2021 06:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRVdT/dr5DMlUGvoeA403kMAu03POHrIYBHRP0MnwVRNzk7By93vZhPbGOzR/HRXm5r9Brnusb7F7efl0hM2dkJszqzFY6Qc+0TQepwfqQ1o8U6ZTFO4TRB3gJByC5VpltUR0brwVKaJ0U++9uPZSsbxLVDB08Ea9Fr6WYBPIIVzzDH9BGti3Goa17Dwdevhq5Nodjuw3YNn3Gaa+nJ8zfvvujDGNbKl3t3WWxsIPIfhszv8VoOvkmyFEg64bUoAjK3TFLvDSdGu4NuETLpuMYsrgKIV7Xsq2lUw1WpiJ+j3ED56h5YQ2iC2v3oqy0IgJ+UreHnh3GOtKdpfWXJBJg== 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; bh=E1xvIdyS9VGvEUVxngtEgFQ3lOzbJnmfe69W7ESkQ1A=; b=GzhVqpwt6hQj/e+F1gNEeuh41A5Rq583AB860VKM+Y71YD68E/lcohAy+Rs38v1YeuEy/Wfv6sZmSN5r9XHN2SePta564mxVOiB7+pOcJOvso1h+dIMbu1WtkBSJkaqeYJoPNXE6oYbicHf4aHVlC2cC547c+eBqAFK5sXsc2KTek0/9NPZYOy2rShF/VCxEHAbXhBU+nHpNZeQWkoUtloH9FrMbNixSEdudOjtgaBIeQRW7aTRR/A+qe9X8ob39XdOfkQ0qTRuzD9pvu+tfNJw7PybLkaE6dNVrTdu5r0JT2Afv8PAdzUCVuLo5086I4+HSdgJFUeEJc4cQYykh1w== 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=E1xvIdyS9VGvEUVxngtEgFQ3lOzbJnmfe69W7ESkQ1A=; b=ZNRuaPSxKjdeyl7kpPW5PLijPSgZdDFRAn9dHYhPGRgUSJ0mqdWYPVJ0nsd/Flui2GdV+ad7nRYFGdhKM4qWh21Ip3Ed1fjsh9Ng9Qd/3dj0hozaFEbyZLRyDXSKslPCgKAlFYEzqylB6M16cpd5wNNLTqcbt4wnjVwXZO/G7iD1Qo+zGvQCI67UztOuAk3ZumMC1xD3tlMPIdS+kD6HbXkfKtwGny18n6L61LOd8nL87gKTRTF4i1hDg8rBQ3E3REG4cdQi+Vw4ZaxEzATLb+uQIMwyJii4fuhJcVY+DpWhACNUakCRUZZ4Y37y0f04AfUqzSFOLNw5ljq7w+wm5Q== Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2603:10b6:5:1cf::26) by DM6PR07MB7050.namprd07.prod.outlook.com (2603:10b6:5:1e9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Fri, 17 Sep 2021 13:54:53 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835%7]) with mapi id 15.20.4523.017; Fri, 17 Sep 2021 13:54:53 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] RFC: Add `final class Vector` to PHP Thread-Index: AQHXq2Dr5ROExEhu802SAlX6zd1M+6un3yqAgABWubc= Date: Fri, 17 Sep 2021 13:54:53 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 960f949a-b19b-43b0-e6c4-09d6cfd497af x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [Kal1bpkutMNH/maa3aU6loa1FDVvPx/KXOY3Qq6ZxHE65qGhyTfO5+NgkvjiiHRF] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecf458c9-2a61-4395-c5be-08d979e2b9c4 x-ms-traffictypediagnostic: DM6PR07MB7050: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: c6WyRenCL49LiArD/GKLtGb4RC0WLsaz5rgWmmEoTuXMzCLDdmI2s1xye2YkvRAQ9edR7R5O1xdu2iTomevQAA5pBjdcnTfnRpndEFQ1AcHrg7T7gEnD0eSqADSrGYwasJZHIRopcmIVhPZNoNrTt47WyD1Lha9Gjy6NfpCmxfYWDpDDB1zVD8bUbfMe7iUgJEK7sAKs+Sbss+wxsDJJTw8Oumqw0ju3XZk5bLOPaK1jws97yoQBvTlgxonwRZcqinYMmdxi0RrVdHnsLaCqke7xzq47bH6eN6t1GzlKCGzfyisnZMyh2FJh97u3RMbI68eqpKa40YAU2CAvSXkKuXEn47e0ZICXxtl/TAKqqx9BBfKCTl5w+L+HpGWe+MIU1BM+Q6NOYaNtk9t+UzjOtEZ4N3To5BDVBo8RrShV36UeewEX0oM/PFp1n0IPGxzs4652oUu9DmDsgM46WQ+n5Ao/+xmEBs0HajpsBCI+6SE= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: /jSJrbHb0hosrBFgkFmwTHw1vegcS2mmmkbyHLZe4RCdZY/BUX0NPNDipwSC4VMy/s4YEEi0kNAR04SPJbMRJNSZcmGCdfR3FZfCwQy93ZJa6KXkvL2r4hIKYzihUTE4xwWZzfUIFZGVPesHUwVCHm/hWkZHe2sTHrgMa6ItY3IU/qt9J/nFeVFXx6U0Hx4DJgdtqbDkZlBEjnyMo/BRPA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-35401.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR07MB6618.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: ecf458c9-2a61-4395-c5be-08d979e2b9c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2021 13:54:53.4736 (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: DM6PR07MB7050 Subject: Re: [PHP-DEV] RFC: Add `final class Vector` to PHP From: tysonandre775@hotmail.com (tyson andre) Hi Christian Schenider,=0A= =0A= > First of all: I don't have a strong opinion on a Vector class being usefu= l or necessary.=0A= > =0A= > But I have two comments about this RFC:=0A= > =0A= > 1. Using the very generic name Vector without any prefix/namespace seems = dangerous and asking for BC breaks.=0A= =0A= I downloaded the top 400 composer packages with https://github.com/nikic/po= pular-package-analysis/ and didn't find any classes named Vector.=0A= =0A= - Only php-cs-fixer extends SplFixedArray in one class. It can continue do = so.=0A= - I don't see other classes called Vector. Just stubs for `\Ds\Vector`.=0A= =0A= There are tradeoffs and objections to any possible choice of name I could m= ake, including this or alternates.=0A= =0A= - Too likely to have conflicts=0A= - Excessively long=0A= - Open to adopting namespace but objecting to migrating existing classes (o= r not doing so)=0A= - Objecting to a specific choice =0A= =0A= > 2. I don't like that this class is final. The reasons given in https://wi= ki.php.net/rfc/vector#final_class https://wiki.php.net/rfc/vector#final_cla= ss seem unconvincing to me and restrict the usage of Vector in a way which = makes me question the usefulness to a big enough part of the PHP community.= =0A= > These two reasons combined would make me reject the RFC at the current st= age.=0A= =0A= There are alternatives such as making all/almost all of the methods final(e= specially for reading and modifying array elements or basic properties of t= he vector), but allowing extending the class.=0A= =0A= -=A0Still, I don't think that'd be very useful, and would make future final= method additions to Vector backwards incompatible.=0A= - Trying to do everything (e.g. be extensible and handle all edge cases of = extension) has often resulted in many spl data structures doing not anythin= g very well(efficiently, correctly, or possible to make universal assumptio= ns about or optimize in the future with opcache/the jit).=0A= =0A= While it is possible to extend ArrayObject and SplFixedArray, very few thin= gs do that, and it'd generally lead to worse API design except in a few cas= es.=0A= (E.g. `UserList extends \Vector` wouldn't be able to enforce that inserted = values are actually users with final methods)=0A= =0A= Thanks,=0A= Tyson=0A=