Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112393 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15617 invoked from network); 3 Dec 2020 10:13:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Dec 2020 10:13:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D6282180511 for ; Thu, 3 Dec 2020 01:41:04 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 01:41:04 -0800 (PST) Received: by mail-wm1-f51.google.com with SMTP id f190so3215128wme.1 for ; Thu, 03 Dec 2020 01:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=YniuRIbAZLGVf0BCWdgMp3Y2l6xh5XMJpu1Aw6hinxQ=; b=YsdYMhPt4U5x39fEG5phqAu/xDa/fdRpBLSGPKaX+7BCxgInVDxs6ahRlyBaodtgis IVXg0nbx0gQVNFSWFFZ4ciDvJgoUU7ec1gHqzjs2+XhjvtW3ln2rjOUdmqAUC3X5UyoH wSghr5rIYxQadmfTOvtKQQ4OR3B3GK7f8x88KdGBScR/hHBLKqVIQwDhMxPrUDO2TgLu Br/7Vx5NorkX8amdvhS37VTvzwT7hedia/Pi2sxquryLz9zc5aHZXCFhQdkWoqtNaRwf dpZa3KvwuZKMMLS0KLTR+P1q8GLiotMSs3Z9uB4xY1z5NK2IBor7BC/Egw4lRJzeG9Ht /r4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=YniuRIbAZLGVf0BCWdgMp3Y2l6xh5XMJpu1Aw6hinxQ=; b=P8db9Sh4zfwpLtsTNM99/3GVzUcNqB/5j43vPSkZFOE5TFRpEB0dx25Jq1nwGhlSBy CzLRpC/IFEdw0JAkVLdbJwKeL4upbtDSuAAr32OgBICIV92NoyuB/ewA2c5pr8H1erEs I/aBLBS0YqFlriFrvCZ5NZnji8wxdVKOO17Mv+4Hdop64uftKfKBcOg87nIGVKd9HuJG AupGzSGVXt570UNrPBy6z9ypN0QZ3nNs7DGkvJgGr0vKGz3800Gb0yYLW7BnayvtGsSM B0XwGpz7MHs7aZrEKOi4/6EzR73NP91rscMdN2jj62Z5C262Qo4OPnkdwQmIQh3kZsR7 beTA== X-Gm-Message-State: AOAM5327Y3/5SKlVTAvlJq7c61I+o6BPxlo2cBRb57MUUlo9i/55S+0I KK2zra0kL3I0BNAXPa5Vlsqd2O65BQs= X-Google-Smtp-Source: ABdhPJwxfco9O+LtY9x0rsWXxCQOVseYCEDR3NbWr5hfBRAFtL7pVj3hWQlEJAaURwRp+AS0fvlw4g== X-Received: by 2002:a1c:67c5:: with SMTP id b188mr2331024wmc.147.1606988459595; Thu, 03 Dec 2020 01:40:59 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id o21sm1151392wra.40.2020.12.03.01.40.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2020 01:40:58 -0800 (PST) To: internals@lists.php.net References: <0774c293-afd7-d8b9-175f-217ed600d1ea@aimeos.com> <8a33dde2-f06c-640d-42bb-3e7af90fd5af@gmail.com> <75b5b870-112a-f54e-1fd7-4d425ffa8000@telia.com> <1d612903-386e-630d-f91b-fbe7590e41e6@gmx.de> Message-ID: <10208740-ec3b-7614-9668-b7b580ecb4cf@gmail.com> Date: Thu, 3 Dec 2020 09:40:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1d612903-386e-630d-f91b-fbe7590e41e6@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling From: rowan.collins@gmail.com (Rowan Tommins) On 03/12/2020 06:52, Stanislav Malyshev wrote: > PHP functions always returned null on bad parameters, so it's not > exactly unexpected. and On 02/12/2020 23:49, Christoph M. Becker wrote: > Just to reiterate, the former behavior was documented[1], and the return > value was*undefined*. Instead of returning NULL, the erroneous > function call could have returned anything, even TRUE. Relying on > undefined behavior is bad. The note on https://www.php.net/manual/en/functions.internal.php says: > If the parameters given to a function are not what it expects... But the prototype on https://www.php.net/manual/en/function.is-file.php is: >  is_file ( string $filename ) : bool And the description says only: > filename:  Path to the file. While it's clear that passing e.g. an array falls into the scope of that general note, it doesn't say anywhere on that page that a string value which contains "\0" is "not what it expects", and I don't think I would ever have guessed that before reading this thread. So I stand by my assertion that this behaviour was both undocumented and unexpected. Regards, -- Rowan Tommins (né Collins) [IMSoP]