Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112397 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38749 invoked from network); 3 Dec 2020 14:02:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Dec 2020 14:02:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DFBCF1804C0 for ; Thu, 3 Dec 2020 05:30:23 -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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 05:30:23 -0800 (PST) Received: by mail-ed1-f54.google.com with SMTP id v22so2063624edt.9 for ; Thu, 03 Dec 2020 05:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=OIWJVJXP888awgQ7QcDyXHGleZalGcoZ901+8cPwWkQ=; b=f1GeoCubn2zSEYlDzhzwkUhbjZ34AVyCXipq+J3qAeEbGScfk/edVfl+FM62Hl4tOB wZKxcWYXIRPJstwzkWcrcEKhHdTrrwBWZfmG2QxL4mqePwZyC2DYoHVJvBqdGkA359Ug jB7m5jSGXq5QH0vZPYIOiSiKuXT0BWcOvLsD7U7q74Fc8+xBdD15KZ/+H15JtlOv1SOe AHF+uAyatcCTbR32iZmX/k37T103n7lMd1pxx6n6YeTwspttBXUYHU1AngYb0pIWzaVQ 3h8ihYc+vNaOZUICbY/s2GmVuYMYMaVVUSPvKi7Qok4nwnqAt0l5BFucsXm/qDfqPeXl zqiw== 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:date:references:to :in-reply-to:message-id; bh=OIWJVJXP888awgQ7QcDyXHGleZalGcoZ901+8cPwWkQ=; b=roa0bEQPAEYaH0dx231yiD3pQAaV7ZTT7szshHCfShoXs9tEIAjeUbq+UaGsfu4nRF 4gRdNQ4LckDChyBvMZiDsNtBOtyNAjSRQNiBDLM2YheZ4S9o8LtfwNfAq0gInKVveepN LVUWbQFykRqzEfUY6YOob1k0cafN7YKGMIsbBUEniwQLS/PdmJqkrWStaPGxeg3IceZ+ 76W1Z0fBAs5Oewu9dgVxRhARM1j5z5gp5GUUDjK74FIS1YotZcH0JGM5lfs5lUtjIgSc NlVVRMBZnxAS7Iuy3D85yj1/fa0fKxSqJcxlRFc5QgzHacZ6I7EoAJoao9OEUjDyOlbX Ag5Q== X-Gm-Message-State: AOAM532UDjktqWrYp91apGePzHSuzdXV2vtmSiS8OQ+HmcgkwkuN7TOU NuTQu0O8e1n2u05sBsUnRWm01oUGEEw= X-Google-Smtp-Source: ABdhPJwZxqlb1Ou2FbT8dfTqMatmikSQfugI+ooAKewfqt205PMTetQWP6qig4xbWVCJJ51vMOGM4Q== X-Received: by 2002:a05:6402:411:: with SMTP id q17mr2844842edv.125.1607002217226; Thu, 03 Dec 2020 05:30:17 -0800 (PST) Received: from claude.fritz.box ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id u23sm844233ejy.87.2020.12.03.05.30.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2020 05:30:16 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_A8BA29EF-9CD4-43D7-BB58-8CA72D0574E2" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Thu, 3 Dec 2020 14:30:15 +0100 References: <34FA3E20-9D06-4D08-937E-4216FEF35504@gmail.com> To: PHP Internals In-Reply-To: <34FA3E20-9D06-4D08-937E-4216FEF35504@gmail.com> Message-ID: <7E98C687-7A24-49E7-A14C-3D68B4B3419E@gmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Missing warning for stat(), etc. when invoked with empty string From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_A8BA29EF-9CD4-43D7-BB58-8CA72D0574E2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 [Of course, I meant `stat()`, not `stats()`. Resending the message with = correct spelling, including in subject line. Sorry.] Hi, `stat()` 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 = =20 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 `stat()`), 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 for failure condition as = in `file_exists()`). =E2=80=94Claude --Apple-Mail=_A8BA29EF-9CD4-43D7-BB58-8CA72D0574E2--