Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112387 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69052 invoked from network); 3 Dec 2020 00:21:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Dec 2020 00:21:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7D9E3180531 for ; Wed, 2 Dec 2020 15:49:30 -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=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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, 2 Dec 2020 15:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606952967; bh=hFkESmxX9ZFY9P378sUiOPnWpwqDFAOp8kr4vhzX0VM=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=kDgX5tmjEnhQgSlcs8U6X1LX9WQ/YT+8V6K7NoWTYOdsqCEYZ1vfcPJuhi1XyRs9i trfxahhhqLRdDhAymtDbVjvJbRTFypwWD0nP+HqWuoO5u7CzKVGtYknHkxBu2LJSAN wEeWiEECsNO9t1wQgnI2ZQqCWQ6Qmyj/mRK4MV4M= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([79.222.40.233]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKbkC-1kRyYs3li0-00KvKo; Thu, 03 Dec 2020 00:49:26 +0100 To: Rowan Tommins , internals@lists.php.net References: <0774c293-afd7-d8b9-175f-217ed600d1ea@aimeos.com> <8a33dde2-f06c-640d-42bb-3e7af90fd5af@gmail.com> <75b5b870-112a-f54e-1fd7-4d425ffa8000@telia.com> Message-ID: <1d612903-386e-630d-f91b-fbe7590e41e6@gmx.de> Date: Thu, 3 Dec 2020 00:49:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:S7wG7BMOIZslXE1q2otMlTK99tQhwDs7td8oOqCfxbMyUsojvfY PI39J79qUV6C6NLtdy8ozCfAn93cwdJmtszz+pEZ6OEaYxu1OlyK7dPX/G+dnp62dDM0OMY kQoIPDrUMN2GgmAf/lpAyX1HvLCgy/6dgNs+XDu7bSGn2RPHUI/niFJMZyv1Z45fTYm6oZB v4vmNfgOxL/6wkGl5p6qg== X-UI-Out-Filterresults: notjunk:1;V03:K0:ARRIn8Wbd/4=:iMYEqVh1BOWSKrNcxlMuWR suIBohJ6hm+MZboItS5VJhIe8AtKejQkkirPLu/mRPnWWxaIPEmFwxDyflbqvoSA6heU+16x+ Z3k/7QRKs6GPmn1OijMD5YXqv677vatDW/Yw5AMZxhgWeEW+D0/TwNeY+84kklOym4Dl1prDk KYyHPKFx3735MaAx6GIEj6oUYKBZPT7FaPLpDMxNUyK4NpabcTcsbK/pULJRMISyFpcfgZe7F tpY1W0NeAYLaKEvItuwpvab9hyJb5Em3aENjNbMiOBRjlCGt+9BnkGI1DW7d+c19ddrkwaXEo njXrqZCm+fMk5XkvXOi7Qx2WGDWjFFnSQ5Luy9ZopcjahO1xfyfpqf6S9hyHmNRVp6Sln7jdj 0cf883rc0+Pu+gISPPqkrbo9xEiCtW88irmETLm/Umf5FNaO58itDtFm1PcihjLWFosOnEwAy L7vbYzZyW6Wq9YXpcIjdRMTqtGyZwlUhp+wsvhCNdqTfun3oqnQb7VOBQjzPWjCOHij+IKDvi YCEJpF/oER5d/tiE5hqyJTmFdrbv0VQ5sdm0NxXSW0hlmRQqwgooddcw/jRZ5g4VutOAZa/t7 ld2TsTTlZeARRzw8UvevwftRhrEH/Fbr/He2GaqOQWQgjxSLLRsktBqQ2+N+BKXBlQG3p4NYI rdES47WG7qW+Os8hB50sDY7xQJEMogEH0SP0vpwl9FmbyYLVd0Jx9BxqdS8A9/BbiNrJl9r0H xrwDV9CVS/OWIQjHnL72Pe04Rk+OGxeh0djKmxrBXymwDGHRLuP4U6ohyf7PHQ+32ireC2ppO UZGMidtn0IdsCsGUADzDYdJhZKClIzbY/Z7J095lHixt+Uj7WNXZeVbEFlfgG8Bwjm9vYmclB F/5bdIz4/J0aptzGkcEg== Subject: Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling From: cmbecker69@gmx.de ("Christoph M. Becker") On 03.12.2020 at 00:06, Rowan Tommins wrote: > On 2 December 2020 22:38:13 GMT+00:00, "Bj=C3=B6rn Larsson" wrote: > >> One could add that here the PHP programmer need to do work that >> basically >> replicate how the code worked earlier for little gain. > > Just to reiterate, the previous implementation was also bad - it returne= d an entirely undocumented and unexpected null value. Just to reiterate, the former behavior was documented[1], and the return value was *undefined*. Instead of returning NULL, the erroneous function call could have returned anything, even TRUE. Relying on undefined behavior is bad. That said, I'm not against changing the behavior of is_file() and is_dir() as requested, and also the behavior of is_readable(), is_writable() and file_exists(). There are likely more functions/methods whose behavior should be changed accordingly. It might be worthwhile to identify these functions. And we should also explicitly document what these functions returned for paths containing NUL bytes prior to PHP 8.0.0. [1] Regards, Christoph