Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112396 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23529 invoked from network); 3 Dec 2020 10:52:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Dec 2020 10:52:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 59CB3180531 for ; Thu, 3 Dec 2020 02:20:13 -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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 ; Thu, 3 Dec 2020 02:20:12 -0800 (PST) Received: by mail-ej1-f45.google.com with SMTP id bo9so2575292ejb.13 for ; Thu, 03 Dec 2020 02:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=7wizi8xZ+eOtSslljz3z2vTEbPd3/k7/Xj7Gx1VGi6s=; b=iVtYza0JjQFAkRhA05PapJFEllJbm0cej9GKiwY30sM315Ilw2fkjHPZoSVIp4WUZg c7R4dpWXGvs0FINbQRvYS8GiPaBgQPO4O6pzLvCSlw8E8gR1sBv/31e2CGGrBFr92OEx js/RyTtpQU+KYAnkxzsnO7yzWr4GpDGPfm1tOaOCYxWBh4IlLIUmtlIpOOKr0nIsQeeQ dV3UvDj2PUEGN6xzGenMSmBhUJa3O1WyoY/2xveFIxVP9MPEB4sdW3uahhcaJWDJ95Uv kEfkj2M6kN/QjMpIEAJpyWg3ALONj6vkrn90oll+vAnsu4kyx82XzDZV050QVji5yUY2 KeOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=7wizi8xZ+eOtSslljz3z2vTEbPd3/k7/Xj7Gx1VGi6s=; b=I5MBKqbSudPnmE5htr8qVUUPljApgzhH435hbglGxd1kdIG8iWJhdxjxqhhDsrTC1f 3r6rup/x1kV4B4wa9jOgUGn9eeYW0iKOnWGIVn+74OE4/YUR8Mk+90ye3FWNHbyQNLag +D3MhrMHD4FYGbBsP24K6QTKnIjVHMR7crwVu/9zQE+rOtOmUvhe8ukKm1AGm0AUGzSA 0Yr/XIcYBCh2PiCo2my8Nb3SXcZzjS76uLcIitwnJpIjN7MK3CDdp58693lERI7/ihTr NOfCTAue+jEcSd3LRR1asYy1MkjYKtUzO3S0NtSpyzIdje5cUhapbCyxUJFGlNSZUOMe kNmw== X-Gm-Message-State: AOAM531+xSV9Mss7VE7vnIlutXu42PPF27IDBjvEQEqpJBmrB9X/WbmV gddpcIykjzaM1cjlk083AyHQZzaHC6s= X-Google-Smtp-Source: ABdhPJzNFRE0CmIv1mx2QYIXPjOQlz2oakhFifCuOTAbePEWKeXeBQ5nM3ImsccuwZ/k9G17HpzbJA== X-Received: by 2002:a17:906:5847:: with SMTP id h7mr1813396ejs.124.1606990809017; Thu, 03 Dec 2020 02:20:09 -0800 (PST) Received: from claude.fritz.box ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id da9sm824764edb.13.2020.12.03.02.20.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2020 02:20:08 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_DA812E17-EA67-43B3-ABA6-4B17C73D24D7" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Message-ID: <34FA3E20-9D06-4D08-937E-4216FEF35504@gmail.com> Date: Thu, 3 Dec 2020 11:20:07 +0100 To: PHP Internals X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Missing warning for stats(), etc. when invoked with empty string From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_DA812E17-EA67-43B3-ABA6-4B17C73D24D7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, `stats()` and friends invoked with empty string or null as argument, = return `false` (indicating failure), but do not emit the Warning that is = expected on failure. See: https://3v4l.org/jXC2N = That discrepancy between the two ways of indicating failure is = problematic. Indeed, whenever I use one of those functions without = prefixing it by @, I expect that it will either return a value of = expected type (`array` in case of `stats()`), or run the panic procedure = of my error handler. I propose to ensure that those functions always emit a Warning in each = and every situation they return false/null (provided, of course, that = those functions are not supposed to return `false/null` in absence of = failure, and that their purpose is not to check failure condition as in = `file_exists()`). =E2=80=94Claude= --Apple-Mail=_DA812E17-EA67-43B3-ABA6-4B17C73D24D7--