Re: Re: PHP 8 is_file/is_dir input handling
| From: | Benjamin Morel | Date: | Tue, 01 Dec 2020 17:58:42 +0000 |
| Subject: | Re: Re: PHP 8 is_file/is_dir input handling | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112342@lists.php.net to get a copy of this message | ||
> Furthermore, Christoph's code uses str_contains() which is only
> available in PHP 8 so it's not a good workaround if PHP 7 and 8 must be
> both supported.
>
Here: https://3v4l.org/LHcmN
(https://link.getmailspring.com/link/CF1DFC14-E01B-46B3-9719-6DCA72108EE1@getmailspring.com/0?redirect=https%3A%2F%2F3v4l.org%2FLHcmN&recipient=aW50ZXJuYWxzQGxpc3RzLnBocC5uZXQ%3D)
On Dec 1 2020, at 6:56 pm, Aimeos | Norbert Sendetzky <norbert@aimeos.com> wrote:
> Am 01.12.20 um 18:47 schrieb G. P. B.:
> >>> Or is_file could check for it, handle it gracefully, and be a safe
> >>> function to call without worrying about this undocumented edge case.
> >>
> > Apologize my email client sent by mistake:
> > But this has always generated a warning see:
> > https://3v4l.org/7E2mv
> >
> > So this is not new behaviour.
>
> A warning is OK but now an exception is now thrown so it's very
> different from versions before PHP 8.
>
> Furthermore, Christoph's code uses str_contains() which is only
> available in PHP 8 so it's not a good workaround if PHP 7 and 8 must be
> both supported.
>
> Personally, I would agree with Paul because the additional code that's
> necessary for the workaround complicates the user code base.
>
> Best,
>
> Norbert
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>