On 03.12.2020 at 00:06, Rowan Tommins wrote:

> On 2 December 2020 22:38:13 GMT+00:00, "Björn Larsson" 
> <bjorn.x.lars...@telia.com> 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 returned 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] <https://www.php.net/manual/en/functions.internal.php>

Regards,
Christoph

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to