Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113960 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86174 invoked from network); 5 Apr 2021 18:06:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Apr 2021 18:06:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EB5E71804E2 for ; Mon, 5 Apr 2021 11:05:08 -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=0.8 required=5.0 tests=BAYES_50,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: Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10olkn2018.outbound.protection.outlook.com [40.92.42.18]) (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, 5 Apr 2021 11:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lEzK4YAtMfCG+bwdwgqS1OQ5HnJZK5Z8IQta5DYnfSRwM++Vdi4YSlmqu9WIuNGUinQJ9wXLW6oDaXtut8RFXIOEUkkYuVCwjdaWdqYjT+Q5YZysBjKbPH2OOASJ+oJ77Gvw4ZLdpGhSCRENyqo2l6MYwrzD0e7UMxhkgedlGZGeD8KeI+IL64EiB2Y66Bl7aW3LkqhL+LDDYa5idIf7HAfOvutE2O3U5denA/0O8c2v43fwSqWWhKS28aiSKoZ8ickjXG7dGt3dWv8PKSZeoQLFyo0nwpMok+a4iVDPIM1Eqwa4MVKNq7Kz3Enrkf7MhXzIMcE1o6v4dZBwzJhAfg== 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=R59g7wy+fEHRvJVDy2pUKERNrHwUCbiYuA87AT7NXqo=; b=E53ef+85fFk53cB52rNWEsmSrxS+zYGuvMobwykwY7rTdckgjlg/K0cbHS77BvtRch5T2uXdCdVkaacIas3oJb+Xa9d2ZsNKrImMb4BIzyUNO06jQ90ZvHE6cnR3/Kyq1UYgtE+T15FJpyuh9vNqDbyD5lGECOm/6WQZcWfVzFnVklwd+8OVTOBtlU2GmiUSSFoJyJq7+A6OctlaZey/Ay+oqUByr2Kc3HHmgjH3iRr+hXPCaAouslAzO6NJK2GBZMLVThgKwrEusMv+I1eX92b1wo99/QQhzSJRxPj9VP374c/BWjeqGHZ+0HV8QrnJ2ZdwIpptMAFmpYK5xHVzsA== 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=R59g7wy+fEHRvJVDy2pUKERNrHwUCbiYuA87AT7NXqo=; b=cOMTBM9dmHSjVMfblyaPwGVmIFyTTvXQSQoX34EALdGiAZrda5Hc4ml1mhrfpDMck3nHjVDhLWJRJyoL7mlw5aWpPRFZ+GKLwXIrDWrEISWOyWNGe7qBG6TsLCR9zilbjzGcSYaN0BC56/oDCFIocLqz+mLMQA1KW0t5uJnLqGvUyUbYyzGT6x7L+y7f3j9HpB3y5aKAhR/l6eh9fM7rUrWw1U7Ug8Bo5XmeVx7UuISxlzwKG7QFDDzHZD+OBh9ZMj7VueeY0+s09B6aaevRHvatkO5ohTT/9Xyaj2Kj0XXkWRDG/T+7mRxjubV3RORcxDpqBwdDvfY2mQ5dcv9X4Q== Received: from DM6NAM10FT014.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::4a) by DM6NAM10HT071.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::305) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Mon, 5 Apr 2021 18:05:06 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e86::4f) by DM6NAM10FT014.mail.protection.outlook.com (2a01:111:e400:7e86::281) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28 via Frontend Transport; Mon, 5 Apr 2021 18:05:06 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9c7c:2273:6416:6a0b]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9c7c:2273:6416:6a0b%6]) with mapi id 15.20.3999.032; Mon, 5 Apr 2021 18:05:06 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [RFC] Namespaced in bundled extensions Thread-Index: AQHXC7SHipPpM/LzWUe8BgLIli8g8qqLeJKCgAAEBwCAGuoYmw== Date: Mon, 5 Apr 2021 18:05:06 +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: x-incomingtopheadermarker: OriginalChecksum:8DC3DF4B84B52F4964ADF228B1779DF1A14E1F2B575257516F57BF41E60869D6;UpperCasedChecksum:AEBA32784BC5C3FB631B37FF498F5051F4623C1E5FAB71D224FA21F51A1D83CC;SizeAsReceived:7045;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [aBjDC7CR8JetQaWyJEGinNZkb8ruKSKV] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 7c83df00-5f1c-4fd9-92a3-08d8f85d580c x-ms-traffictypediagnostic: DM6NAM10HT071: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zBiYpRuMWoCWu4xcWxU6OGqg1Ns2tEiPUTBlG1jNu6iN4pPZ7+zC2VeB6s/cQXzK80UCRF8HzfPZ/EznTsK0QXtSHOT2+LjF4A33oQEmhQMJfwDy+ceMoaRKkppz7CcpCMzr5hMx9ehEu/qSIlr2t7T48UzXREEZUvjSlfDa+lJ4I2Pz09dGVdc65jk6GJq8KCXku4Ax8pzecZ35ZLPVscV6iVBF16Zc6UNFnE4b1nZQAZfnSqjsgSzfVqBQnWxL7U/sAs/we1eKeUPd7gk8j8EVrQ5VybD8U5pWIeycltTV+z/5dmUDS6ieoEvMVey2hhIXryP11X46H1Rg7LxIa1oYX417aek2F8BHMqebAy9U9nxpf9iGDlWgzWS7sfIiJzg6FZfc1GIad0kAGo3whb+b+4IrcQU+qYZ/Y6Sh8H874lk1stF8v8GGABgBlSWn x-ms-exchange-antispam-messagedata: hObSrxl/N3VEtOzSGBewsOlm5QNesXf4NXaaV/7MVIpZprc45GbvaTVJORglSpv5RRA9kjd1rN7+DSVus1yDdondH5PmIqaehXBmJjAx7OOaOKmgm6DwNYbKAMstEui7Ru9isJ8q9QbLnkr08xnjsg== 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: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT014.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 7c83df00-5f1c-4fd9-92a3-08d8f85d580c X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2021 18:05:06.4871 (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: DM6NAM10HT071 Subject: Re: [PHP-DEV] [RFC] Namespaced in bundled extensions From: tysonandre775@hotmail.com (tyson andre) > > The question of namespaces in the stdlib has been coming up a lot recen= tly,=0A= > > so I'd like to present my own stab at resolving this question:=0A= > >=0A= > > https://wiki.php.net/rfc/namespaces_in_bundled_extensions=0A= > >=0A= > > Relative to a number of previous (declined) proposals, the main differe= nce=0A= > > is that I do not propose a top-level "PHP\" vendor namespace, and inste= ad=0A= > > recommend the use of "ExtName\", in line with existing practice for=0A= > > extensions. I believe this addresses the primary concern with previous= =0A= > > proposals.=0A= > =0A= > Both of the namespacing RFCs have been announced for over 3 weeks and I d= on't think I've=0A= > seen any new discussion since then.=0A= > Are any updates planned? When will voting on the namespacing RFC(s) start= ?=0A= > (I had some stdlib RFCs/RFC ideas I was postponing since February to avoi= d interfering with the namespacing discussion)=0A= > =0A= > I'd love to have some more feedback on this RFC before opening voting. Th= ere has been a lot of discussion beforehand, but only a couple responses to= this RFC...=0A= =0A= I didn't plan to suggest changing the direction of the RFC, so I didn't hav= e much to say.=0A= I guess it's an improvement from a user perspective and that splitting core= /PECL/composer namespacing wouldn't make much sense,=0A= especially with the ability to polyfill most core functionality in composer= packages (especially with PHP providing FFI, low level socket/stream code,= etc).=0A= =0A= For something like https://wiki.php.net/rfc/cachediterable I'd still be fac= ed with the namespacing choice among multiple options if this passed,=0A= but choosing names for everything is out of the scope of this RFC.=0A= =0A= - `iterable\CachedIterable` would be the most likely, although it's also in= some ways a datastructure=0A= - For SPL, e.g. for a new Map type or existing classes such as SplObjectSto= rage, =0A= there'd still be a number of different names such as `DataStructure\Map` = or `Collections\Map` (DS is already used by an independent PECL)=0A= - "When adding new symbols to existing extensions, it is more important to = be consistent with existing symbols than to follow the namespacing guidelin= es."=0A= raises the question of whether existing iterables should be aliased to a = namespace around the same time=0A= - 5 years from now we may have a different group of active voters, so if th= is passed with low voting turnout=0A= I'm not sure if there'd still be arguments over the choice to use/not use= a namespace.=0A= =0A= For a future iteration of https://wiki.php.net/rfc/any_all_on_iterable it'd= help if there was known community consensus (i.e. the vote on namespaces i= n bundled extensions finished)=0A= =0A= I didn't notice before, but I assume you'd still planned to summarize feedb= ack so far in a discussion section before opening https://wiki.php.net/rfc/= namespaces_in_bundled_extensions=0A= =0A= For https://wiki.php.net/rfc/namespaces_in_bundled_extensions#core_standard= _spl=0A= `use Array;` and `use String;` are currently syntax errors for the unexpect= ed token "array".=0A= That could be fixed in the parser by adding a special case for namespace us= es,=0A= especially now that T_NAMESPACED_NAME now allows `string\contains` to be us= ed without a syntax error.=0A= =0A= One possible concern is what would happen if PHP implemented new functional= ity that overlapped with a fairly well-known PECL/Composer package.=0A= E.g. if there was already a FooDB\Client in a composer/PECL package, and an= independent implementation was later added to php-src,=0A= there'd potentially be conflicting names.=0A= Being able to implement `PHP\FooDB\Client` would avoid that ambiguity=0A= =0A= - Then again, other programming languages such as Python have no issue with= that, so never mind.=0A= FooDBClient\ or Foo\ or something could probably be used.=0A= =0A= > All symbols defined in the extension should be part of the top-level name= space or a sub-namespace.=0A= =0A= This should be clarified - do you mean **the extension's** top-level namesp= ace (e.g. OpenSSL) instead of the global namespace? I assume the former.=0A= =0A= Regards,=0A= Tyson=0A=