Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112468 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97401 invoked from network); 8 Dec 2020 16:58:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Dec 2020 16:58:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A187B180532 for ; Tue, 8 Dec 2020 08:27:39 -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=0.0 required=5.0 tests=BAYES_20,HTML_MESSAGE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (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 ; Tue, 8 Dec 2020 08:27:38 -0800 (PST) Received: from macbook-air.home (unknown [IPv6:2a02:1205:5053:a220:bdc4:147b:5487:7155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id AFFCF6C0C64; Tue, 8 Dec 2020 17:27:34 +0100 (CET) Message-ID: <8D795AF6-5C6B-4BB4-A773-6A7BB04503CF@cschneid.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_3C852E24-2CBF-47DC-97AF-5AFAFD8BD603" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Tue, 8 Dec 2020 17:27:35 +0100 In-Reply-To: Cc: PHP internals To: Mike Schinkel References: X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] PHP 8 is_file/is_dir input handling From: cschneid@cschneid.com (Christian Schneider) --Apple-Mail=_3C852E24-2CBF-47DC-97AF-5AFAFD8BD603 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 08.12.2020 um 17:16 schrieb Mike Schinkel : > 1. Please consider making is_file() return false for an embedded \0 = and no longer throw an exception or generate a warning. The PR implementing this has already been merged for inclusion in PHP = 8.0.1: https://github.com/php/php-src/pull/6478 > 2. Beyond is_file(), please consider allowing PHP to support both = types of error handling strategies without forcing complexity just to = use the 2nd strategy. This is a contentious topic and will have to be handled on a case by = case basis I guess. E.g. for security-related stuff a fail-early-strategy throwing an = exception might be preferable, for basic lower-level functions like = is_file() returning false was chosen to be preferable. There is no silver bullet for all cases and having a global switch would = only make things worse. - Chris --Apple-Mail=_3C852E24-2CBF-47DC-97AF-5AFAFD8BD603--