Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120351 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44604 invoked from network); 18 May 2023 21:34:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 May 2023 21:34:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 673E01804AA for ; Thu, 18 May 2023 14:34:31 -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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 crocodile.elm.relay.mailchannels.net (crocodile.elm.relay.mailchannels.net [23.83.212.45]) (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 ; Thu, 18 May 2023 14:34:30 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|alan.smithee@fivecolorteam.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7FF0C82144B for ; Thu, 18 May 2023 21:34:29 +0000 (UTC) Received: from pdx1-sub0-mail-a254.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1CF28821949 for ; Thu, 18 May 2023 21:34:29 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1684445669; a=rsa-sha256; cv=none; b=IJO2Rhx4lMwiE/Y0q4WvH/jQfISYbQJgmSVeLIFt56AcdgKnQztc5VFYwkI0Zf+7mcF2D4 1s5LCm89kahEMHSF3gGaud4clr6tEQLHGzQNB7aOcHPvMbzC2m1Ir1L9yaRQWZ6SBhmpU1 6G0e/IHs7lIdqUY51YNXUdN0nsrKAZ5KqViFnR7EvjQw1SeBeys7e3Dc1DtqtA4t4Zgf/6 M/oNFHWe5+Mr17TVMWfIiDnZjcwjnqnErxQz5RRwvjggqehDh/b6aIxf4EsHiHLhdQLWlW 45rDLFugySlyF8K6s1xN6Joekv5BCOkDV6F1rzu4UGAzDJ+vF6BVMqX3aOlUoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1684445669; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=wAgLTRM3grhp0Dby1IIRymD/ILCdRgZZYsDuihbTnuM=; b=Yapl2/et7H/rMbMkS0kz1N7FpH5aVj7bGoZBFNTsjYX1EiiQKeQaYOyP3jdFtG+j9vGoBT lVNRzjBXH78LliTFL21foIZuGSjemefEsx4u7P/ZRqyijWTsSyYGkgRNVmx2p2I/e+tWhN Kcru5NV5nVQ3ykrTseIJE5lorQLBhhNqAYZEM+E4p9HTp4HX2ZWR89k26JGq7gY1h0DiEb LT7k0+HLCQqbAaGlfCLQ9DhTsPBDUBtmAf7U5S1Vc9nMQ5TuwENW5X2IL705tjxb3N3yfM I0lf+hBdLkvNzw9YeXXfjAXvPzRWun8jqyKo8b/s8omjiTP9gufJGLmgJ4Capg== ARC-Authentication-Results: i=1; rspamd-79bb5575d7-r82sw; auth=pass smtp.auth=dreamhost smtp.mailfrom=alan.smithee@fivecolorteam.com X-Sender-Id: dreamhost|x-authsender|alan.smithee@fivecolorteam.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|alan.smithee@fivecolorteam.com X-MailChannels-Auth-Id: dreamhost X-Tank-Duck: 6a5bc66b1d49d379_1684445669349_329472698 X-MC-Loop-Signature: 1684445669349:79605712 X-MC-Ingress-Time: 1684445669349 Received: from pdx1-sub0-mail-a254.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.193.157 (trex/6.8.1); Thu, 18 May 2023 21:34:29 +0000 Received: from webmail.dreamhost.com (ip-66-33-200-4.dreamhost.com [66.33.200.4]) (Authenticated sender: alan.smithee@fivecolorteam.com) by pdx1-sub0-mail-a254.dreamhost.com (Postfix) with ESMTPA id 4QMjsw6SDCz2Z for ; Thu, 18 May 2023 14:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fivecolorteam.com; s=dreamhost; t=1684445668; bh=wAgLTRM3grhp0Dby1IIRymD/ILCdRgZZYsDuihbTnuM=; h=Date:From:To:Subject:Reply-To:Content-Type: Content-Transfer-Encoding; b=Y0FyPfOpj+2nSlQDdoOoepLVY83kG/b9v+NEB2jerI8YxsAiWBkV+gG6SVoz+Bap9 nKxt9/2METPG6APk9HoN3MzIkx+TLQi27wbmKIfx0QRrfPtnUmTLMHa8XC0+q3qYOu kHBn6ki/tZLzR4Xi/1EzCxc3P25XOBT2kIYvyed5cu+AsWyFzd2guKEW/Y+2y7ChQS wXC60ZlHgG/AvEklUUBr3rUWcx8ELYYSAIM3t3avWQ2lqpDaDNTvcBNxwN0v01q+ZL 5o15ArOa428iVvndO0lnP1QHF1OppkHaXL99Zl/2DlAOBCncOZR7uaZypiWD50nZD8 PHpuOH+d0ws8g== MIME-Version: 1.0 Date: Thu, 18 May 2023 17:34:28 -0400 To: internals@lists.php.net Reply-To: alan.smithee@fivecolorteam.com User-Agent: Roundcube Webmail/1.4.3 Message-ID: X-Sender: alan.smithee@fivecolorteam.com Organization: Five Color Team Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: PHP 8 Backward Incompatible Change Notifications From: alan.smithee@fivecolorteam.com (Alan Smithee) Hi Internals! Looking for counsel from the PHP maintainers here regarding the upgrade path from PHP v7 to v8. There is a subset of backward incompatible language changes that are remarkably tricky to track back into a codebase through manual code inspection, automated testing, or static analysis (...I'd love to be proven wrong here). The behavior change in these cases are triggered by data passed into functions or operators at runtime, such as "String to Number Comparison" [1]. Using this example, in a large-enough (and legacy-enough) codebase for a data-driven application where there is a cost to every change, I am struggling to find an effective mechanism for targeting the set of all equality comparisons in the codebase that could potentially operate on a pair of number/string operands. I've found that the most effective mechanism that has helped me to quickly and comprehensively identify areas of code at highest risk for the upgrade has been deprecation and warning notifications provided by the PHP language regarding backward incompatible changes. To this end, I'm considering patching the current version of the language I use, i.e. v7.4.24, for my own benefit and introducing more notifications for the handful of highest-risk, backward incompatible changes not currently reported by PHP. I see Nikita Popov has already done something along these lines [2] for the "String to Number Comparison" change mentioned above. My questions for the group: 1. Are there any particular reason(s) why some PHP 8 backward incompatible changes, like "String to Number Comparison", weren't instrumented as deprecation or warning notifications in PHP 7? 2. Are there simpler or more effective strategies to account for the set of backward incompatible changes I've called out given the constraint of a large, legacy codebase? [1] https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.core.string-number-comparision [2] https://github.com/php/php-src/pull/3917 Thanks in advance for any insight or advice anyone may be able to offer! -- ALAN SMITHEE Software Engineer | Five Color Team