Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107890 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69077 invoked from network); 29 Nov 2019 01:38:39 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 29 Nov 2019 01:38:39 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 79BEA2D1FCC for ; Thu, 28 Nov 2019 15:33:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.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,FORGED_SPF_HELO,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10olkn2039.outbound.protection.outlook.com [40.92.42.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 28 Nov 2019 15:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ei8GLe+uJMmTOqKFvT0p/BwU5le64y2cw5W5D1OxVutowFrr6ygGVQyVXnl3qF+RkC/QFfJIzIIVSH182i21A7STy71ehU5w/9EFnRdJ0C1Tu6XcrFmtN5tQb//aokbQ5W5TS0HDsGfEoR3wpr6of8iRPYQZ2O+QAnhZtESEKpslfOWjRfij49Vvc/wR/f7l3UdxnffOwYLrKOe8XUkxu0UkQQh5ZPrsrEQty75ae4QF5Inee+79KRIWIUgQycnxNRlOLsjfPE1q2uRpGAoLh4Bddv8xuj5L3aeQckTgrq4YT7KJRYw4rhpYGcHYDSUPsS+TLOFOYDdDWVDxTemCxw== 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=L7W3DP+pxXE+Fb2dpoul0n0PhtNed6nXnXc7HBOi+B8=; b=VKpvfC64PDC1+ge39PueT4DmYv2Iy0ECYsurASJuPHqthJogATrPizl0VsWxd1axvVNpeKovKqpneQ29zxuS/bhLGM1kGLVAeJ5PbOKuJgHxHnLjHEUowHaZHYkQgJE4TKEiJl0QClFfOac9phAzBw1roetBgYQNMoMzAvVhKY6e9Ff8UyLmU6WLfygUJN6OVHqHVEEdIUSt6c3g1WUt2NYmf4XreF7AYmpWJ1nUcoDC4858Njw1exj0/3ut057lCIuzr1nFDQF0D3ku2tzfyxwKTR6fGp5gZ93EQYGDtZJVseNZBboohtNX3dOdgqYvCecMFdaSKO+95sMgx8f0IQ== 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=L7W3DP+pxXE+Fb2dpoul0n0PhtNed6nXnXc7HBOi+B8=; b=eYFgoBOFXMOXEY+gnQEIAs5YXB23uLlDVQJUAIeZGsGk6M4L3191vjreBzsJm0K64amfeCuXShqKbtt2rVDO36nhCqazH+MoqU2stOKUZpM4I672riPMAI8VYW+G9g5m3Lhh8Il81CjYS8HHEiN8DCGzIMJpezv62cRTZlRoqkKqzgedN6c8fpFnqpMNZPHy3siG6PAgml+/Dn39GG69WLS7+P9JZA3Duzfn9z8FFESo72FU2UwGz7w3qKetuusWsYSL90WVArldWpX4S0OFQ4MM9CLfZNacwscoLdgDmlBCVbuM4RbY9lhXchaR04Xq0E6Uw2E5oRscdLpLgIVa0w== Received: from BN3NAM01FT042.eop-nam01.prod.protection.outlook.com (10.152.66.53) by BN3NAM01HT166.eop-nam01.prod.protection.outlook.com (10.152.67.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.21; Thu, 28 Nov 2019 23:33:51 +0000 Received: from DM6PR07MB4553.namprd07.prod.outlook.com (10.152.66.54) by BN3NAM01FT042.mail.protection.outlook.com (10.152.67.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.21 via Frontend Transport; Thu, 28 Nov 2019 23:33:51 +0000 Received: from DM6PR07MB4553.namprd07.prod.outlook.com ([fe80::4403:1abb:a4cf:76a4]) by DM6PR07MB4553.namprd07.prod.outlook.com ([fe80::4403:1abb:a4cf:76a4%3]) with mapi id 15.20.2495.014; Thu, 28 Nov 2019 23:33:51 +0000 To: "internals@lists.php.net" Thread-Topic: Opt-in "use function *;" for skipping check for function/const in alternate namespace Thread-Index: AQHVpX6vrwD1LJEJ30mFfcAOFan0sKehOly8 Date: Thu, 28 Nov 2019 23:33:51 +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:CE3792CCD35609437A295B5E8F63AF5FE3367799BB8C1CF0D2AF3B247BF3F5D0;UpperCasedChecksum:50D52FA3E11B73829731AD8B2B788E11817AEBE3687963BB81ABCAF978CCE2ED;SizeAsReceived:7217;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [XNM17MSbqXK5phREZHVn/y4ZMvlyfFkKqR7T9/XR3HwhkwkKMn7d9FiytRop4cIk] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: cc32a0f0-ed32-45ac-8d5f-08d7745b6d2e x-ms-traffictypediagnostic: BN3NAM01HT166: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iJ2/US63zWoFuwn2WJ1c47adEqZV2KUjGazeanw6R07UI/JNMD177sNCaXZZrO1hWfA8XAEgXu0xwHbIx+i8FuDnFe6plH3XiNu/6TQBa0DSwd6Lo/eI+gqQhBruXONIaSsxt0tPYb61/h9YxWiwY55XyZbo5WdQFKTmwgxSeYKUZJlxpzV8jHKFuoF7ofVe 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-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: cc32a0f0-ed32-45ac-8d5f-08d7745b6d2e X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2019 23:33:51.8258 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM01HT166 X-Envelope-From: Subject: Re: Opt-in "use function *;" for skipping check for function/const in alternate namespace From: tysonandre775@hotmail.com (tyson andre) My previous message can be seen at https://news-web.php.net/php.internals/1= 07887=0A= (marc.info seems to show it as base 64 encoded text.)=0A= It links to a PR https://github.com/php/php-src/pull/4951 implementing this= =0A= =0A= >A more cosmetic consideration is that the more generic the syntax looks, = =0A= >the more people will want it to work for other use cases. I can imagine = =0A= >"use function * works but use Foo\* doesn't" ending up on websites like = =0A= >PHPSadness. A more specific statement, like a declare, or "use global =0A= >functions", is more obviously a one-off.=0A= =0A= Good point. My original thinking was that it'd allow `use function Foo\*;` = to be used in the future, but:=0A= =0A= - With the way namespaces work, using more than one "wildcard" would result= in unintuitive behavior.=0A= (based on what files were loaded at call time, and what the order of the = `use` was.=0A= =0A= Also, instead of checking 2 namespaces, php would have to check an arbitr= ary list of namespaces.=0A= - People new to the language would assume `count` would keep working =0A= despite adding `use function Foo\*;` (e.g. seeing that require/print/isse= t/empty/eval resemble functions,=0A= and would continue to work)=0A= =0A= Also, there's the large difference between PHP and Python/Java.=0A= The functions in the module are known at the time of import for those, but = not for "use" in PHP.=0A= =0A= So rethinking it, something non-generic like "use global functions;" would = be my preference.=0A= =0A= Initial plan for a voting structure:=0A= 1. Whether a way to opt into exclusively checking global functions and cons= tants should exist=0A= 2. Whether this should be part of declare(lookup_functions_in_current_names= pace=3D1) or a "use" statement, if it does exist=0A= 3. The preferred "use" syntax, if there is not clear preference ("use globa= l functions;" or "use function *;" or otherwise)=0A=