Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117519 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13328 invoked from network); 11 Apr 2022 17:37:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2022 17:37:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 432A818033A for ; Mon, 11 Apr 2022 12:08:48 -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,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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.17.22]) (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, 11 Apr 2022 12:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649704123; bh=egLRHHmf0e3341mQ7hq+cXOcAHBe7GopJBBWMKukfeU=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=cbQMIoP65qSEbXnTCBrB4ZGJFfVd1gjyiomqOhijSLxb2VHLWRriqs1w9CSklGTZF MZDq08dYRfjUN57KTQzDZd4UxslkBXnNWTtxPcepsggWyOhw5mmsRIc1dz9GxNkfoB CMT+vsaNzx+II8xBVvsQ8ZgvOtzKNkUEIvjZGMZY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MUGiJ-1nVunY05x5-00RIWB for ; Mon, 11 Apr 2022 21:08:43 +0200 Message-ID: Date: Mon, 11 Apr 2022 21:08:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LY6QgTprI7UbGBiw6d4ObFDgXSx4nzrgortw80/B2rRVj0PZWOB UgTfh2h9+M+1lxN1wZlZlbB5wllry4yvJdmQ+HE0GKl1iOJ2zOQgeeuCtLq6Z+AbmhnHRvj t9ouwZMyugst9qhCRkKNfU3pzI1EK7GoosopAZwG/zK0aeuozGkKcvTIzDSPeaGfdMTZBwb t9AfG3zV0xMQbi0z3GKZA== X-UI-Out-Filterresults: notjunk:1;V03:K0:QulEWpokKo8=:CcsIf+AUBDr4iy0WhYiXsu /4200oWt2Aq2baz5sHevrN6iF9rLnp+QaN2RqPBxx23W1IOHIdxB29wgEWpurcmq2urTHXKAw VLZ85qILFAB6e1uktt2yjBZZF0BJeOLVlj/vFUG0q96pW6BxpYhftgjsJ9RI+ABsuEqIsikzN 8dX37oByoJlemMcwK7Lt/IEtKGcHyuBC/oUig7C9d2UvFjU111wDB9Zx4PrmVX9HN9JnVhbTV T1MQroQnjxvLseBgPXTMoQaMRk0M66fx/EQLU12bbc6JTHgvVNz2nmNDAH241uhb1+68Cja11 6qN/hikqxvN2TfFXc/Vu3g/5ZFBlbgE/e7TnmsiasjRzWzyNniv5+deeXLMr+YK9XQ19RG9Qv nz72FsozezlQ1vOUdEh5gwezwxYT8o9Au9ZqRXndqwbUqmewct2gVM9BeS0CraZU3K5vMstvX pe3TrO9pWOxuDGNn8axY6CBjTpwTShEI9wjwROR4nVTWI3QOW16Pg3gYST9DyfETkJhnjdJRA mPr5gjZBhYRgfx8dxNwdnHbRgVj9eoN/2ZEZnjnvTgFewQOXudtlrzi+u6WcqilwjjTQTebM3 ro5L/dpr0LDrAW0KsR7HUVtjftCyuw6cCFsWtCjTDxcPD6PpUNstNyKPG4gHbV7kezBxXNwFL x71ExygzE1rWvqwCiJLtwqSsL2qhX/Z8kdLjRboI+0a4Zik0KDNveB+OqcS4sDhdactZQGgUA hEBogMsLo3hksUsPVkXXhamS5S+NsQ7SxXcSkFyf00sCVBwsku3tCRo7Ut3hsZ2BYZWzcQmyo DZ52ieD9v0GscYQbg18GSpKIKaL+EGjYx0H+42nS7eIM3Zeim9uHO8W25g2Lr1pq6WJfO8cYu OCXC9CUYmneWwdccdYAq+v1h1AmFR/Cm7urQimjxH+k3QuBGMgys2eiiB5h978iRgFt9DsZ/I yz9GWMCdWY638pI7XwxjwXt4G5c+cATZofoElIYI04zgNLa7wYmZXu/iNKWxOmTVzY7Uq8xEe sa5ccuEZ+ENUl0L+i9Y6DLLS5iThaCmecqfPYpBUmp76ycRshc1O2q7P4HacPhqRWEZel6Xvl 2yUHRiOF2NFvxw= Subject: Re: [PHP-DEV] NULL Coercion Consistency From: a.leathley@gmx.net (Andreas Leathley) On 11.04.22 20:22, Craig Francis wrote: > Just take NULL to String coercion as an example, the documentation > clearly > and simply says =E2=80=9Cnull is always converted to an empty string=E2= =80=9D, this needs > to be updated to end with "... except when being passed to a function, i= n > which case NULL will result in a Type Error" (I think that's "broken and > inconsistent"). You are taking parts of the documentation out of context, and omitting the start of the whole "Converting to string" section: "A value can be converted to a string using the (string) cast or the strval() function. String conversion is automatically done in the scope of an expression where a string is needed. This happens when using the echo or print functions, or when a variable is compared to a string. The sections on Types and Type Juggling will make the following clearer." In the same section it is also defined how resources and arrays get converted to strings. Following your argument, you should be able to pass arrays and resources to a string parameter because there is a clear definition in the documentation of what then happens. I unfortunately really don't like the direction of your RFC, because I see null as a real type and because it increases the divide between strict_types and not using strict_types. I have never used strict_types - in modern PHP code I find it unnecessary, if you use parameter, property and return types. I am glad PHP has decreased the difference between using strict_types or not, so your direction of trying to increase the difference seems like the wrong way to go. Ideally I would rather want to see a future where strict_types can be removed/reconciled.