Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112376 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25507 invoked from network); 2 Dec 2020 17:24:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Dec 2020 17:24:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E7C301804C6 for ; Wed, 2 Dec 2020 08:52:24 -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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, 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 mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 ; Wed, 2 Dec 2020 08:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606927935; bh=4iz0+ng62Q66GQ/vnH5qNHROqBM3TQyml5yPFqA4n9A=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=iz7MDDajbJKVm+42vaPX6RA2grFEOMjBwxMqYv4xwPxWKHiH6hV4ORU2tCEeFTSOw WJ3ld4W96d/nfkuvs1vvoxMe/XAjsFpG7Rdcyt2nl1vJmQ7gwhZCG85aNZCG/SjIBD lvnBzUtWOOryy6BaChm0dgfJyb6SSxT2PVvNriLk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([79.222.40.233]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MHoNC-1kw6CP2Cfe-00EyFS; Wed, 02 Dec 2020 17:52:15 +0100 To: Silvio Sparapano , Josh Bruce , Nikita Popov Cc: PHP internals References: Message-ID: Date: Wed, 2 Dec 2020 17:52:15 +0100 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: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:g/SxCTMiZaGvHzna7YrlwsDR6PrWVV/JMdMgXWudXKN95p2ry5r kY2UYXM9r4xn+5Xl0MbaPZQNUhXdyZposRQkxg4N+GXIyYXmlIv/HYyqr9ahHi0Ve6/KI63 VnRdNbfyTxnC7H/KMy4w+3xv2jhRqFnwVftGFFhYMDuiE2kMp75jckNbrViz1QqbiLfnkgo 5zjSblPMtOGgxDgN6sqbQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:cn0u3XWCHe8=:zRsFkHh34bSca7DhtyGwTz 7FxXAtfvsM3U2kIefHlor3myJZd7dlTp2rW+/ezfNOqVfCA5O4sWCXbuI9nSTpJNTosrnRcY6 xVVSEkpHVa4yrvAjLhoW+Jvu15ssx0p3taIkaHJYwx3iSCGNUZeTnCq92PJJo/fgN0btIgwUo w1k2PjhGFvEU4vFEsONMfqeyEGu1gEBsMzVqqKZQprqfj+lAdJnKNRkzF9Vp7BZKLRpfecP+s 4nr3ZM1oDifq1nwxByzeh5oeyAX89EUsTaZ07HaKtWUYqZGIkfkPvNuY9/UOqNzmmitvax6QH GXaD8NkbkJUKVR1IBKoH09X6gKG9KXQKjFt7uZIwlHxO5ZqJppvG2e7izYYMdQ1O1UBjHG26h v1HhNXnQnW2DtU6dNOTXPFxziofw2mkmCPwf7l7OmcAG0DW5jRKTm1eZsQbNh+rz+5jH7YrNd uXoV5G5n44ELFEwV6+yV3KlGC+tQ9hy9dtDA1i8GyGB8rlu8Tc5wvHkVexsG2ChFybNpSZO1K axfy8TlhRwOhNNnn8fvofxAdPqSRO/wwlONUOXSIbNbrCLhvpVGLMm9jugJjP10uO4yjiXWDW j5rOVzUg9I4O7uZ+/MybDUM99EOPLiV8smT0o0JGWy+D5qvBAc7JXf1FbOxKQPOHrSDjEnIYF vBWFOmlHuitR34v1fCpOs6XJOFudy2aKTHm+TAHHqAvMBCdjXe00LDn6mNDLn3bkMdiD49TD4 UG4exWbRediM+PY1akfZpI9Aqw/TgmCkdwm5gKVn6aHKj/42CugFQ2LD5o1LQi7qV9ODQR/i4 JvF0WBlPmeMl41wJz4VMTnnSSlpp351iL4wTwnrG6z3nEj2FkZY9u7dZifdUIkKNeHlEfqdlZ 6ol8ewn9TC5AjDJMsMIA== Subject: Re: R: [PHP-DEV] [RFC] Deprecate passing null to non-nullableargumentsof internal functions From: cmbecker69@gmx.de ("Christoph M. Becker") On 02.12.2020 at 17:34, Silvio Sparapano wrote: > Hello, > IMHO it=E2=80=99s only a declaration issue. > > In other terms, if documentation of strlen says: > > strlen=C2=A0(=C2=A0string=C2=A0$string=C2=A0) :=C2=A0int > > then I mean that $string MUST be a string, and return value MUST be an i= nt. > > But then we found that if $string is null, zero is returned. If $string = is an array, null is returned =E2=80=A6 > We simply need consistency between how a function is documented, and how= it really works. > I mean, it may also be convenient for strlen to accept a parameter type = other than string (such as null), but it must be well documented. It is reasonably well documented: | If the parameters given to a function are not what it expects, such as | passing an array where a string is expected, the return value of the | function is undefined. In this case it will likely return NULL but | this is just a convention, and cannot be relied upon. [1] Regards, Christoph