Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117524 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56181 invoked from network); 13 Apr 2022 17:35:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Apr 2022 17:35:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21D331804A9 for ; Wed, 13 Apr 2022 12:08:02 -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.18]) (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 ; Wed, 13 Apr 2022 12:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649876879; bh=c+t5wTxAplzqjqoowkbCs7inGVi/KDVIyazdzg8qDMA=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=KTsnhv1wMCIfyDCQkyr8OXG78t5NPM7wYVPktG9+2esZ5I2j2asMRHbwE2oGOyHmz AUUyRdjBcQnjNDW30xxdiAky3ucmYkuUJ0zJL9sRnm8Y8kVMucS+Y8QRV75ZfJ/4wA oSfKiVjBx3jYChm6O2//bJJ34vUoghGq6xVM80Fo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDNl-1oIj0C3DNH-00qnIx for ; Wed, 13 Apr 2022 21:07:59 +0200 Content-Type: multipart/alternative; boundary="------------xle2Qc90h1rAknvpG007s72w" Message-ID: <2035695b-b6b5-5982-a5ea-e85693e1f71f@gmx.net> Date: Wed, 13 Apr 2022 21:07:59 +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: PHP Developers Mailing List References: In-Reply-To: X-Provags-ID: V03:K1:uRS5ff+S4+FwjS+LpbmF+FWbSqd0WhglQPYB99lq/WAKsnMVDTF o65n0hFrMMEaCDsBjqjhmbNQV8WKgRzIr1/dgck6NWYKryW7SStDCTg1PibBrwZRlpO2uQU C1tC0BnM7g0CK7CNu5S09TuRsA3pLlJIHg9PDjW1vlwvTJvnM2nsVHVQCKowjxMB2JLx6PK t7yJtFIxF77XucfPEMoIg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Jx96n4TjWuQ=:G/LXxWRN1bFIqPxT99tEhV IXHiQAgKIdn+EkjoT29qF5/QE9C21EZStVxtkKSYjsTFdgiPQXlvZjWpICGJ3vqWp50BSkHAC VQv2+DleKD5d7pmzMyvfIcuhx+lg6lIGdBnszplyK1zGml3BAj+6ibnRXDW/aSjCgMohXzJ+I tEbiP3/Z+HXADfXTcGHLONTPkfCyF+CSZvZnW1uWGPHnuxYBuonUNKGZ3P4bA4zVEDSUhuaXc a4eWpRB5tGrUymDrVqTJ5b68gXtMnWUQiWQA4ItKj3AVJ8c2GNYM34t1PV//sG0gPpQ4MLagu mree427CR8XsinV2tHTq3JbiODI/MEroX05AFbSmAvDY1SIZBJ2n2A3Ij8NBHSRTWFB8utT0j DRb+hZgKssyWLIF5+Q5RoavSUVX5uU3qWqUB+XNPQcF5DWvKbFZG7iK/5a7LumlhO8PQfKoGY OWc7XllxChimNoKb1cSRMRQwRFfElcAAeowmPwlswlqvEiOsMhsSREiRWBAfDywb4M08tzsXs pQ1U/wg61h/I/AtUqT03Tkn+mTZw5Z/+0oT756cSHPpSE+78qEOgDUVe0h+Pp3yUolZ53w8ze 1wlzlHPqHekzJuPWx2aCQPvJ4o3h9Odu9dJSyx9WreOrXTeM6lLP6kTlBqcC6s6CkvxukNMQq 0u7dGFSXAevXOycmmRahz2iwB2RsbxFX97SnQoMAqbe/jXN/qmSBg+ufcFITfdNopcf/stX8D XYKELiCq8UwTKOCRxVzTjwEb6zMTg6RqBrhEXSJgRgx6/CzYRMohg2kLCzzkNuapOAObNVBbF Ata+LpnPHnueun4WvzLoC62T2MAgV2jaLi3rm4xMO2c4R4Ia9LeGsvKBIfV7+sYd69L/MTs+d REuaZWb77rrhE7vp627gBMtsLgbrPeEnHAW+AW+088zlOWAKCV8tlRYd5v1VOpm4bPSAf1fBO sIyG8UPaoBPrz3jt0lTmnAeo/9Pzu1nlcWCFmgD2vGfbxwVTHN2hBR654Lbr+rzM+q8KmywVO ElZ4kKVDfYCg79NHgvmTYRWiEDRgLzljSHOrX0lBRzyNBenbfcgo5S5takOmmKdZNhvp3xCeg Hzn9Vb/0eeBOOQ= Subject: Re: [PHP-DEV] NULL Coercion Consistency From: a.leathley@gmx.net (Andreas Leathley) --------------xle2Qc90h1rAknvpG007s72w Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 13.04.22 15:36, Craig Francis wrote: > On Mon, 11 Apr 2022 at 20:08, Andreas Leathley wrot= e: > > You are taking parts of the documentation out of context, and omitti= ng > 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 t= he > 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.= " > > > > I'm sorry, I've read this several times now, and I'm not sure what > this adds. My RFC simply quotes the paragraphs that explain how null > is coerced (other than the small abbreviation for booleans, those > paragraphs are included in their entirety), I don't think it needs any > more context than that, it's not like I'm mis-representing how > coercion works (and is used) in PHP. > Mentioning the documentation as a reason to be "consistent" (which comes up again and again in your arguments with this RFC) just seems like a bogus reason to me. It is nitpicking about specific sentences in the documentation without refering to the surrounding context. It would be nicer to argue according to real technical arguments instead of arguments about sentences taken out of context in the documentation. > You can see NULL however you like, but most developers do not share > that view. NULL has been passed to these functions, since, well, > forever; and changing code to manually convert NULL to the relevant > type is incredibly time consuming, and of questionable value (e.g. > when developers simply add strval() everywhere). "Most developers do not share that view". I find statements such as these as a tall order - did you interview the majority of developers around the world? Are you suggesting you are talking as a representative of a large population of PHP developers? How do you think you got such a role? I would prefer some humility and not assume you are an elected leader of an underrepresented group of developers and even knowing the intention behind their code. "NULL has been passed to these functions, since, well, forever" - this also goes for wrong values being passed to functions since forever leading to security issues and bugs. That is the whole point of developing a language: Reducing the surface for bugs, improving parts of it where a lot of bugs have happened historically and not making the same mistakes as other languages (and learning from the good parts of other languages). More people writing code in a certain way does not make that code better or safer. --------------xle2Qc90h1rAknvpG007s72w--