Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110785 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40778 invoked from network); 29 Jun 2020 18:01:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 18:01:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 930D8180088 for ; Mon, 29 Jun 2020 09:50:00 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2059.outbound.protection.outlook.com [40.92.40.59]) (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 ; Mon, 29 Jun 2020 09:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+YX+PMEmef7xOlaCpQTwAe1dkSu4nnaaGyWi8wp/JN9UIFeTswuhHMFwG8sLVGw5yCZvned2KqLHVwI0osRSs6HynBrbmyJrNrEFFN1B9BxnQz3/F8dxZP7fIqsTDfxM6X+nuM9o4GKyx7Tsu6nc6NY4zOiq0jm9FT1pGV0NVnIVmzL8uZrUtdDbrmWTa50udM5sOD0x7yXo+X47KEtewWyJN3g1ECEmASAPkaewtsK1c79CW7Q0C4nW7CLP3Gczf/IUkCeHhAw3lrmDUtm89rbGwfaZH6tySRSIKYGhm0gmB+WquoQf96RI2O4971LiZhjVRN95sLnfGmURZKfFQ== 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=moXabHBanFHn0KFyRicmsfrk75qzwadoi9ot346J0OQ=; b=K8J8kVGV8SVbpenpxrFFTBVsYJ9jRx1/1CpyT6Mi6LyR+0xgVrxAHa/uD7fULcAoLVqcOZ7fVvKwmE3R5BL/2q7qzfA66jxU7WVG9EkVVpl1N8K0LiMeQ8G8B4gbT2L8HMxi+hWvN3sz+LABTGbW016UBVAi13tU4W0WyLQzvvCZY68KsvWTBF6tnSwlSFkeKCJuNXVahZ0koGQ1HirOpkb1sdRiFKmpZWbDEFehzLEIdAmusyccK5zljQx+hfzcyt4StAUwW7IJJEpug91s6+xHEMES2dyOWoR/SlCCxOQl2dpsQ+ojJ6yYdEYW1AWoEApG1GbQ3Pa+gluFCLEkRw== 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=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=moXabHBanFHn0KFyRicmsfrk75qzwadoi9ot346J0OQ=; b=FS/sofUpD95KSN2WBxYfIx4LLGnRVicumWUn8B03BC2HJ0yIyzdohaciDhF/otm+PZOY/sWMBihowd7egdhuG6kjbP5IJ87pCZrF7PqF1Sate7kq8fo+yT6YtVn8kTxyMhp0+mrk493u3AsWETUXhF4iGr1uWVNGlwMeYrtaYquTiEEQvUEBSwpMYCCmZL2KyuArGfHZ770kk6/5Do82EI2Ki09cVpVsJGc2TeCtDHbQ7pvHfUY0liUe1nqt2/K8Ezo0UbCZMnMNYJX8Bt0GDjVt9hF5J34sKSPLht7ZhyqoFTA+uxJFKx11RpFqu0RMjigBiwZOHfjA2IOwasVpeA== Received: from MW2NAM10FT025.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::40) by MW2NAM10HT148.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::411) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Mon, 29 Jun 2020 16:49:58 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7e87::52) by MW2NAM10FT025.mail.protection.outlook.com (2a01:111:e400:7e87::132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 16:49:58 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21%3]) with mapi id 15.20.3153.018; Mon, 29 Jun 2020 16:49:58 +0000 To: Nikita Popov , PHP internals Thread-Topic: [PHP-DEV] Re: [RFC] Named arguments Thread-Index: AQHWSUaG8sG+Bi+LHk+5vTsbTFlm/ajvvTOAgAAatZk= Date: Mon, 29 Jun 2020 16:49:57 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:02B9AD3502851230BF5564BD176DE445D85F323C910C087526CAD87E357EA1FD;UpperCasedChecksum:EDEEAC581F4276A97AD9FC5294566F4BF7B73D2330EE98A422EBF9B07C791EF8;SizeAsReceived:7049;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [tUngdZH0Fo5jidlRZTCphGCKmZfC8in2] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 9be8b5a5-b285-4ab1-ee21-08d81c4c751e x-ms-traffictypediagnostic: MW2NAM10HT148: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: v8zT2B16CZwCuKyKENjU+xyUMbCigbKX3FCT5euQrhs1EGT+7G1dyYrJZ87g3v46YBKMNgheUsEGaqu4bH4Gwyvr5tup9Dk93nmBzJ0jUCrBD6zfI3QLEiTqRyxk72r+40a/G7NbeA5gx20Q3+WmE7PssLUXyd1glXoKxKZfrMhY5kQrkJ6wSTbv0NIAD8I49p68EjnIDixJOMfzs23AiJLohtW4KkViA1aIDHQkRxSqurdMYF+KJtJn8QSxSlGe x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB6535.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: b9CVNpzoUfYE4z5tj3s1oGqUTMNYK4C/YvuUA1QXaXbpz+0JqADiTx32lmg1ZwUttzDZAugigEd/YlczI3yjlXxG3BHcU+ICCSmKHIlq05Bp/ej/12xQ5vNASK32Gf9BIaWAdrYbE2a2zZhlHtlHew== 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: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: MW2NAM10FT025.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 9be8b5a5-b285-4ab1-ee21-08d81c4c751e X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2020 16:49:57.9599 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM10HT148 Subject: Re: [PHP-DEV] Re: [RFC] Named arguments From: theodorejb@outlook.com (Theodore Brown) On Mon, June 29, 2020 at 10:13 AM Nikita Popov wrote= :=0A= =0A= > On Tue, Jun 23, 2020 at 12:10 PM Nikita Popov wrot= e:=0A= > =0A= > > As we're moving in on feature freeze, I plan to move this proposal forw= ard=0A= > > soonishly.=0A= > >=0A= > > I have update the RFC to drop the syntax as an open question (I haven't= =0A= > > seen much opposition to the use of ":"), and to describe the possible= =0A= > > alternative LSP behavior at=0A= > > https://wiki.php.net/rfc/named_params#parameter_name_changes_during_inh= eritance.=0A= > >=0A= > > While writing this down and implementing it, I found that this has more= =0A= > > odd edge-cases than anticipated. Overall, I'm not sold that this approa= ch=0A= > > is worth it. It sounds nice on paper, but I strongly suspect that it so= lves=0A= > > a problem that does not existing in practice, and will force us to keep= =0A= > > this patch-over mechanism indefinitely, while the real solution would h= ave=0A= > > been to fix the limited amount of code that is in the intersection of= =0A= > > "renames parameters" and "is actually invoked with named arguments".=0A= > =0A= > Just as another reminder: I plan to put this to voting by the end of the= =0A= > week.=0A= > =0A= > I've also updated the RFC to make the LSP behavior a secondary vote. I'm= =0A= > not convinced this is a good idea myself, but some others seemed to prefe= r=0A= > this approach.=0A= =0A= Hi Nikita,=0A= =0A= Thanks for moving this forward. Currently I work with a lot of value=0A= objects which are constructed from an associative array (requiring=0A= lots of manual validation), and named arguments will make it feasible=0A= to migrate most of these to simple typed parameters that can be=0A= statically analyzed instead. For me at least this will be one of the=0A= nicest features in PHP 8.=0A= =0A= I'm also looking forward to the potential future shorthand syntax=0A= for matching parameter and variable names, which could also reduce=0A= boilerplate in array construction and destructuring.=0A= =0A= I'll probably vote No on the secondary "Automagically allow using=0A= parent parameter names?" vote. This is a feature that could always be=0A= added later without a BC break, but if it's added now it would be=0A= hard to remove if the extra complexity causes problems. For these=0A= rare cases it's probably better to update the parameter names to=0A= match or stick with normal sequential arguments.=0A= =0A= Best regards,=0A= Theodore=0A=