Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112341 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85331 invoked from network); 1 Dec 2020 18:29:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Dec 2020 18:29:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 583611804C3 for ; Tue, 1 Dec 2020 09:56:45 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from dd46610.kasserver.com (dd46610.kasserver.com [85.13.163.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 1 Dec 2020 09:56:44 -0800 (PST) Received: from [192.168.178.23] (dynamic-077-008-005-013.77.8.pool.telefonica.de [77.8.5.13]) by dd46610.kasserver.com (Postfix) with ESMTPSA id 5F3BC5F8069C; Tue, 1 Dec 2020 18:56:43 +0100 (CET) To: "G. P. B." , Paul Crovella Cc: "Christoph M. Becker" , PHP internals References: Organization: Aimeos GmbH Message-ID: Date: Tue, 1 Dec 2020 18:56:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling From: norbert@aimeos.com (Aimeos | Norbert Sendetzky) 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