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. In many cases, that will have worked because it was implicitly cast to boolean, but in some cases it will already have led to a TypeError being thrown, e.g. in a wrapper like this: <?php declare(strict_types=1); class Dir { private $path; // ... public function hasFile(string $name): bool { return is_file("$path/$name"); } } Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php