Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112398 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43671 invoked from network); 3 Dec 2020 14:50:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Dec 2020 14:50:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 878101804C0 for ; Thu, 3 Dec 2020 06:18:32 -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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from tls2.org (tls2.org [149.56.142.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 3 Dec 2020 06:18:31 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: thruska@cubiclesoft.com) with ESMTPSA id 64E4C3E88A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cubiclesoft.com; s=default; t=1607005110; bh=V/Qe6c90DLA8TIepiyifWJM6su/WxM7YoWP8MP9fqUU=; h=From:To:Subject:Date:From; b=qCVHo3sn3UeGu0CUs3tZi1e7aO2E915sZUXEt6NakH4AkvW9DKLhyRODv2XWmyMf/ oMntnt6PbRCHYJHkSsDOr6c3prq7oeiPOqx0vZ/Nb1ue00Thqays791mM2vv18A0HB ubXV1Z8ojS3YAfJXrH0e6JlR7H475V9BwdPjqgKlpwiEKT0zJibtql8kD6QfJasKhU LZ3IpJXlBFn7HY8K7vUTsjTlprOVpPULCKnoiVd3ChlXmvel4qwzjQL70QO0opnR96 /FPFcrXpRe5q4eU2xZVDXCXnUiqqiU840VsI3UcH+2cRt1Mlx9CKCfKk9LYTCpEnKs X5fSqPVED41hQ== To: PHP Development Message-ID: Date: Thu, 3 Dec 2020 07:18:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: PHP 8 incompatible change documentation issues From: thruska@cubiclesoft.com (Thomas Hruska) https://www.php.net/manual/en/migration80.incompatible.php Under the "String to Number Comparison" section of the migration guide, there's no mention of explicit casts being unaffected. Using an explicit cast should be the general recommendation anyway. That is, anyone doing this: 42 == "42foo" Should be doing an explicit cast before the comparison: 42 == (int)"42foo" So as to avoid the issue altogether. "match is now a reserved keyword." No mention of variables named $match. Assigning the result of preg_match() to a variable named $match is pretty common. Linking "reserved keyword" to the page with the list of reserved keywords and/or reminding the reader that variables named $match are unaffected would be helpful. "The needle argument for strpos(), strrpos(), stripos(), strripos(), strstr(), stristr() and strrchr() can now be empty." I fail to see how this change is useful/correct. In my experience, passing in an empty string for the needle to any of those functions has always been part of a more critical application bug. I'm also not sure why this is in the "Incompatible Changes" page of the migration documentation. -- Thomas Hruska CubicleSoft President CubicleSoft has over 80 original open source projects and counting. Plus a couple of commercial/retail products. What software are you looking to build?