Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121058 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58891 invoked from network); 13 Sep 2023 20:12:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Sep 2023 20:12:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E88AA1804BC for ; Wed, 13 Sep 2023 13:12:52 -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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_SOFTFAIL,STOX_BOUND_090909_B,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from cyan.elm.relay.mailchannels.net (cyan.elm.relay.mailchannels.net [23.83.212.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 13 Sep 2023 13:12:51 -0700 (PDT) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B03442C13A2 for ; Wed, 13 Sep 2023 20:12:50 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id BC66F2C1340 for ; Wed, 13 Sep 2023 20:12:45 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1694635969; a=rsa-sha256; cv=none; b=iM1mOrkLiMKXdh6jQ/yChacKUxOV5Hspkt4smLi/1k4+yBySmGuc8XE/WXLXUY3fD1y4ZX s5y+35gCGkAhkte5b6qrr9EdpMLkCU8ESqJVPI3qOH6Wc3vSTXSF3bsWek9mXINYizey/R MCGzROx1rpVa6ZlGZdlv38K5qAKqducs9hD4XgzUVZLsie7lUE83zwyfqIO+c602ox3IP8 7AR9oZ1Pt9gSBvUznMTlZxWVUZqzA9MpajhQMd4UmjlLC8inL3uQJJVeE5Z8gkRJA+5lxN 2udlBGvLAtKXwc/YLKU8JCeo6BoUKwtfj5MR1Q6qYXaojUYxNoT+YY6a13i4QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1694635969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rvufE6gGvTSznibHkyCHEB5Q6e4EM9lV35LeYu4MOqU=; b=fQPV4PwOgMhXD0cMNvovypYIi9KSBpEkkwNYJ3KGlWA1jn2agkdIibQMJ2XrQ/6Fl4/6cE Rca6Q+vZRIYtF1PAqJr0+imK1RGVxLXi0rOyMAAWtrdz6/p7HRoACJNRe2uaj0tkzXlW9J WaEd3dc3pOaK3X9FX/4hMGIivSnwWr/BTa0KCSnTy3m94u2Q9EN3TFLvZkKk8ZqtvW/ikX avxc4xPqWu4F+OJSzxXWnE3hoNYRcQFeLdhkz9bNGp+wiC/Wg7HxF7fzJJzk2FxkSzSgZf ZXvvgMsHEoZw0pT+qGErseMvP5Ti8v6UG1Wfmg2IO7Mc+DbXFAjSeWpiPX9ZTg== ARC-Authentication-Results: i=1; rspamd-7c449d4847-xjdl4; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-White-Celery: 51ee4f9b36dbff1b_1694635969725_117001772 X-MC-Loop-Signature: 1694635969725:1326108028 X-MC-Ingress-Time: 1694635969725 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.239.67 (trex/6.9.1); Wed, 13 Sep 2023 20:12:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6mNypW6rdaMVpym6hDcgVQ6ZjhbbokJR0aDf1rDfetQ=; b=ODE8XxqeBZWcZVSAGhEXotb2x+ 38cLqatIl5xiwdtZ/BVu+1ylZogSBVbC2KHM/rMxH++rZLt+w4+2UjAGnaGBHn7KZ5gt2m8Ir6BsG Iykbq9ZkJE9WNSyojwzsVTDZ14Us1JFl6cYf26HEGARZwJQtuizu441Mz3sYqlJa5IUU=; Received: from [143.178.154.86] (port=62620 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1qgWDs-002xZ0-1s for internals@lists.php.net; Wed, 13 Sep 2023 22:12:27 +0200 To: internals@lists.php.net References: <01e3ff17-5088-0431-6014-82ef4e4789b2@bastelstu.be> <48699eff-c0d1-43de-b68e-2327fa601528@gmail.com> <64FE7480.6040505@adviesenzo.nl> Message-ID: <650217AB.6020405@adviesenzo.nl> Date: Wed, 13 Sep 2023 22:12:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <64FE7480.6040505@adviesenzo.nl> Content-Type: multipart/alternative; boundary="------------050702020905020908050101" X-AuthUser: juliette@adviesenzo.nl Subject: Re: [PHP-DEV] Casing of acronyms in class and method names From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) --------------050702020905020908050101 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 13-9-2023 17:48, Ben Ramsey wrote: > On 9/10/23 20:59, Juliette Reinders Folmer wrote: >> With the above in mind, I wonder how much confusion/code churn >> renaming existing classes will cause and if that's worth it, >> especially as the suggested case for the PHP native class will likely >> be determined by the version on which the tooling is being run. I.e. >> tool being run on PHP 8.2 suggest DOMDocument, tool being run on PHP >> 8.4 would flag DOMDocument and suggest DomDocument... > > > Since the names are case-insensitive, if the tools continue to > enforce, for example, DOMDocument instead of DomDocument, would that > cause problems if Reflection, var_dump, etc. began reporting the class > name as DomDocument? > > In other words, if the tools did not change, would there be any churn? Tools wouldn't need to change to change their messaging on this. In my experience, the case of the class as defined by PHP would be retrieved from PHP itself, so without the tooling changing, if PHP changes the case, the tooling will demand the new casing of the class names if run on a PHP version using the new casing. (and the old casing when run on an older PHP version) Might be clearer via the below pseudo-code of typical logic used in tooling for checks like this: $declared_classes = []; if (empty($declared_classes)) { $declared_classes = get_declared_classes(); $declared_classes = array_combine($declared_classes, $declared_classes); $declared_classes = array_change_key_case($declared_classes, CASE_LOWER); } .... $seenClassLc = strtolower($seenClass); if (isset($declared_classes[$seenClassLc]) && $seenClass !== $declared_classes[$seenClassLc]) { // Throw error about the incorrect case being used. } Hope this clarifies my earlier comment. And yes, I suspect changing the case will cause issues when name based comparisons are done in code as while tooling will use code like the above, in application code, names are often not compared in a case-insensitive manner. Smile, Juliette --------------050702020905020908050101--