Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117734 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16950 invoked from network); 16 May 2022 14:03:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2022 14:03:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE872180511 for ; Mon, 16 May 2022 08:43:18 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 ; Mon, 16 May 2022 08:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652715796; bh=KoBZNnkD8j0vMl6nz3/l7io8tAff54j4U47CzqfMKUQ=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=A1Pr57Dv29J8VV8lwbXtSvCD/I68a86yVQGV9R9Q6SGscg6YxEFX3hhxnho/wYGTx 1dTm7trR9RNQD42CAW5IA7oFF93ZUpmA3tEZVVeDr5cEaK/IaINUM4Pb9LRCCSR9wO 5mtTKxCYr4xaq0+wt92bFpkb27Of9HlM91IlCAh0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDJd-1nXkjb2lCh-00qkxr for ; Mon, 16 May 2022 17:43:16 +0200 Content-Type: multipart/alternative; boundary="------------kMN20015veFgnRb5AD6VxuDo" Message-ID: Date: Mon, 16 May 2022 17:43:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: internals@lists.php.net References: In-Reply-To: X-Provags-ID: V03:K1:jNTswhMwXrF4yh/rOWYeLiIDOtxiEYhuzZIwOe9sbjKZgUOgPig QPe89SS8T1mPUOptjZSdZSpiPvL+NWgJiZGrtvHCBVCGUtaJpCAXT5VQVkPNHLyhCxBeqPD UJBGwmG0MVdXtDsT2Uhu8fa0kuzqj6KWKt1EEvfw5WjBPH+87RdUpFKkURI+n0xGGAgjnfH xKuC9+6TJg+V8zOznRGWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1v+SktTk87U=:afnBwfSuLjwh/dtlVUWaZJ UB6D6eea9BCB8yAPazVpwRwinBNGkpjCMcZF5xInmZ7g+/k9YG0PLy31aSary30KuT0DEDTor LH/NRbVyjIC+grLv/SAwZQ4m5qsHhoG10xkDnhWo6Rt5Kg5Fieyo+67kTChwMCiZ2r6lp7/BP cpRWPiHLEspng8YkisfGLd+YKUM+uSxCOrGUO3qTjEGsHLzqslIOWwefMQNu9VFt5R5WEtyFl qkpimHlfpjEQ/eSs+iCvSXYY0Yvj8Xf1KTT+2iNAY3vyqNXKhG46gE84CIDkzT9r2k7qiAncS uOWb+Tdob7NoZxdqhBbPEHhkbvHjUKIfOdssR+bBWH3qLj8TiUjlKtL6vzb73f3+S67AeMnEn 2RYVXMBn2/cEbTr4Gyva4f6zDmmBdVGxlgzR7ljrYz663vaUKv7mISpZL+Iquc/dzKPHI6LZd p5z9YsOfMqfCmVa6Y29sgN9PtAzS/Q819F0C5AMRJQpilqnAQ1RsjCTbf4SgqqcH5VzMawDy9 ec+bA18k/6K3rpD+hozGJRYopDedaNRHnu29SKXkU2RW8Nv3PRTfQjF+6bJDjRyLWoR/I2Htq oUu0VjQwN3KuSm0Kv8tAKSIyY5gFWCQidlhoe0H8sBSUtiSlt45D6WH7Bm4DgTjcDM3mDnY8l zNmqCCz7pKRIYXLY1ZZUG6VZWfEMO/g9M2eA2+LTsdF1bpi9Qbvs6L+J/9yHBNc2WTjTPDz1l GHVXaYyxLI2Kww6E61p1vokyG+PFqZP7HCW5WLd+foN8G7ELU0zYFSgMdMpKY8H8vzYT6JbRz iRK6IK3IVmXye860HkrxxH2lvx/czvjYtld9st40e4M2MS0z5uLC52v+Oh4dwEZ1m1z7ZVRyB YytkTNP8sUV+GfDs5RlipTwqIHWMhclLYG8JY3eplPmQNzoY0L8ATt+lFn+gz4R9dzQ3i/285 zgNsZOa+C/XpKnDI9pzgjKWtAvjPNlbh3wIJaSpODIhH05+F2Cex1aH6t5W4wVtITw6aENlqS HsHTSxYCkkNFWVqZHoAnvVajFZzN/TENjStSFHGAa1ouI0P4ezvzo5Q5KZ/n+yQOo79G1pHSu kxIhkpQvDLOrT4= Subject: Re: [PHP-DEV] [Discussion] Stricter implicit boolean coercions From: a.leathley@gmx.net (Andreas Leathley) --------------kMN20015veFgnRb5AD6VxuDo Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello Kamil, I suspect this is very different depending on the codebase. My main reason for introducing this deprecation notice is to start highlighting possible problems in codebases where nobody even suspected them before. In one application recently I actually had the string "false" (coming from a form transmission) being passed to a boolean argument and leading to true, which definitely was unintended. I have tried coming up with reasons why these deprecation notices could be harmful or unnecessary, but I think anytime they occur there is a legitimate reason to check the code (and make it more explicit). If an integer 5 is passed to a boolean type, how is that not suspicious? Yet I do think this is a deprecation notice that will be far less common than some in recent history (like "non-integer-compatible float to int conversions" or "passing null to non-nullable parameters of built-in functions"), because there are far less boolean parameters in the built-in functions of PHP compared to string/int, and I'd wager bool is also less used in codebases compared to string/int/float. If you or anybody else has a recommendation on how to measure how this would affect codebases and what information in that regard would be useful, I am open to look into that more. The impact should be rather low in general because it is only a deprecation notice, and I think a lot of codebases are getting used to dealing with deprecations more with the last two PHP versions. Best regards, Andreas On 16.05.22 17:19, Kamil Tekiela wrote: > Hi Andreas, > > Has any case study been done already about how it will affect existing > codebases? > > Regards, > Kamil > --------------kMN20015veFgnRb5AD6VxuDo--