Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108307 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23818 invoked from network); 29 Jan 2020 05:52:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jan 2020 05:52:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4CDDF1804F2 for ; Tue, 28 Jan 2020 20:03:24 -0800 (PST) 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,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-oln040092004048.outbound.protection.outlook.com [40.92.4.48]) (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 ; Tue, 28 Jan 2020 20:03:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gkNXwnc5KKCtojzFYFJ2V6QfTTNE32TClcG3BBsJShnqDZMh2NEhtLABQjqdomjTXDov+/6aqOhNSIB+AnisXpu3SPebloIWo9pfkf+5xQFHtxx1fyt9z52Vw71CMAzCLP4c+jZHRrVMfXnue61cE/pOXWfOzDK2aA1n0VfWm87SKjbhybn/c98AATH9LAp+Ct9Xvr86iE5fFKc9H1Jyvb3qxRC5BZcglH+iXciBGHfr98DI+c/ZSU0YfE9CXaytHbKwGznVMQQ/56AyrB3i1eaI8E5B/6zAeIt91cg1EDrJ6VvBpSF1JUxdhXvgOE4BzK1no90/JgimLeHp4+rg5A== 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=a3blVj2cwaqk70ym6Et590fJQ+DI0wL4VaSD7NbE/TQ=; b=jCQq5CkOQRwwS6DUOvn5VWI9qSj9kgXRJ2JhSbTUpXudKdyPd4SySQlY+oMFeYbA0dH2rUnRd5QiKCbIzVaSUkfKhvoBw/n7njAwMwEjgawYt4GWK1A2e7ct8dScQ9jf5VDaulIYIUXJjwaI0KIxFnZodzC1JIb1Oa9p98VLIWA5i9oW1qLdTfqfEJbaa0ibZtaNpqhEgv5B4fPIiI7F+84xVTiygTVGfmJGlcMF7p12v2Hze6FwibSKmmpGcAcQNZG5Tn/SuZZx5fMrSXt1H6YPduWH04HRBBJWb0qqUIE0ifKOLjQiczFajbgTn/eK/NCX+oniSlB5Go0He/WGHg== 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=a3blVj2cwaqk70ym6Et590fJQ+DI0wL4VaSD7NbE/TQ=; b=m5VsIdiVOQWi4Iydg9uqrQuLEBEIFzIjUewL4+3Mrhb1zAYSQk2/R5RmEJ8FvhqpksalPqDgSJgxBwBoKj3MZ/a9/LH6EiHEqsrqJ6y97mskQLmANJolA9l9JkYglw0w1Cmfh4fY2UEMQQqwwsTc/J6IaeSwArYVW7KGI2bRGrede9538E3Cn1zYO9vGl6thuRFHWjKtNl3/3yuppCBBsd8aBSPRyC2By0WHNBSCK07hBwdP44B8jqE09Ukit66gr4lrnkww5g0PCMEjo8IbahCUhAyNjOYnLFUROWiz4v8VUpY90dkwNjdvjSWnMWiouerZiYBMXdnmdoOUgkJJHg== Received: from SN1NAM02FT055.eop-nam02.prod.protection.outlook.com (10.152.72.52) by SN1NAM02HT152.eop-nam02.prod.protection.outlook.com (10.152.73.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.18; Wed, 29 Jan 2020 04:03:22 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (10.152.72.53) by SN1NAM02FT055.mail.protection.outlook.com (10.152.72.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.18 via Frontend Transport; Wed, 29 Jan 2020 04:03:21 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::d512:a8c6:f95a:56a8]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::d512:a8c6:f95a:56a8%7]) with mapi id 15.20.2686.019; Wed, 29 Jan 2020 04:03:21 +0000 To: tyson andre , "internals@lists.php.net" Thread-Topic: [VOTE] declare(function_and_const_lookup='global') Thread-Index: AQHV1kkfok/EDBhgHUCIMQks+1sXM6gBAjmJ Date: Wed, 29 Jan 2020 04:03:21 +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:47503A7EBF739CE204547644ACB95E6CC4A498FA133B4C7E54CD70521E36E4AA;UpperCasedChecksum:7486C55E31492A97B7E068F7F832D5F8F803698B3ABBE07C31BBC1DC84A4BC3E;SizeAsReceived:7007;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [2SaU0ex60GuFQJP34pwg1GLOU6l6aoMM] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 223a4f1e-5a7d-4e85-c5b7-08d7a4702e6d x-ms-exchange-slblob-mailprops: K3wx5smWY1P9/Wgu7i7tZ1HB48pvLYJ1oD4PjNRMDeesglANpK71XG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Bv8Qfw6YFh6K+W+EqGkoowB1P6ipMT6DcGQjQ4AG2ASX1FHQCX+idHA9pjb9UWyVjqtK0hrebSgh2jhM4pxEWyhb/s+InAz1f7N0B1VLbBX4= x-ms-exchange-antispam-messagedata: RQocosS2kOhkKlJ7uVQ4OYjzDtg4Eoc4Tt6UIqoYUECYYwglmrWHxYlBLp+cl//A53dS4MO1ZiY5dfIcULO5qY0UFLAh2ssLirlgxuHPOb0W5akxjuKKXJqFlLsIAEOFhwscgsAEOlI+Q+cJtsKY4Q== 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-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 223a4f1e-5a7d-4e85-c5b7-08d7a4702e6d X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2020 04:03:21.7953 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT152 Subject: Re: [VOTE] declare(function_and_const_lookup='global') From: theodorejb@outlook.com (Theodore Brown) On Tue, Jan 28, 2020 at 8:22 PM tyson andre wro= te:=0A= =0A= > Hi internals,=0A= >=0A= > I've opened the vote on https://wiki.php.net/rfc/use_global_elements=0A= =0A= Thank you for working to address the issue of ambiguous function references= . However, I really don't think this is the right approach.=0A= =0A= The RFC mentions two problems it hopes to solve: a minor performance decrea= se, and developers having to deal with ambiguity. However, a third problem = that I think is just as important to fix is the lack of function autoloadin= g which makes extensive use of namespaced functions unfeasible.=0A= =0A= Unfortunately, the new directive proposed by this RFC would make declaring = functions in namespaces even more difficult, as it would now be necessary t= o explicitly `use` each function and constant in the same file it is declar= ed in. =0A= =0A= The RFC argues that having to "add multiple `use function function_name` an= d `use const MY_CONST` at the top of the namespace" is prone to merge confl= icts and inconvenient to keep up to date. However, the RFC just shifts this= problem from global functions to namespaced functions.=0A= =0A= Changing function/const resolution to always look in the global scope inste= ad of current namespace is backwards from how classes and interfaces are re= solved, and seems destined to become another language Sadness. Wouldn't it = be more straightforward and intuitive to add a directive like `declare(name= space_lookup=3D1)` which would resolve functions/consts the same way as cla= sses (without the global fallback)?=0A= =0A= The RFC argues that writing global functions as `\function_name()` is more = verbose. But is one backslash character per global function call any more v= erbose than having to add a 44-character declare statement at the top of ev= ery file? Developers are already used to referencing global classes and fun= ctions with backslashes or explicit `use` statements, and in a future where= we have function autoloading and utilize more namespaced functions, this a= pproach will be less verbose than having to explicitly `use` every namespac= ed function in the same file it is declared in. Plus, IDEs and other tools = can automatically add the backslashes or `use` statements for global functi= ons.=0A= =0A= Best regards,=0A= Theodore=