Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117159 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57521 invoked from network); 28 Feb 2022 00:25:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Feb 2022 00:25:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C1F4D1804AB for ; Sun, 27 Feb 2022 17:46:15 -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,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 ; Sun, 27 Feb 2022 17:46:15 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id p20so15374619ljo.0 for ; Sun, 27 Feb 2022 17:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SrVrK4X56AwMhtwAxcHEg6NU+JuOgjQFrJ7rH/IkqTI=; b=WS3L7tQE207auhS4pLi57eIhb8t0xSP0gCHiJWeTO/UYqYDmJ9MRCswMphQwgpwVnl QS42mIiUuAMnG504/HAiTAz/+AW5y81XloHsEx8ndXVuenkf23y2nz+9bx05Uvc6437E rsudcGWrXm48z59GengDcSd6wJSoPz6WWAVBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SrVrK4X56AwMhtwAxcHEg6NU+JuOgjQFrJ7rH/IkqTI=; b=WGQxemefLUaHkv4LhPU4RkcMdyKJKDSLn1SEV6bckqbPplrOulGqdLwkN7V+DLgEty wML9uraXLR6/eVbNehUQvYviWpMQKzTFRA2V+R45ltMKOI3HOYo/m+pwqxQvGCNDGLnK 0WXvw+7bN8EQqNXmh95X8Vm7+MrYWjo9dRbAplcUMh8TrQjyxmd/yUBvdlHvttVWpRT0 MbmROLeXdpwMm+k/o0NRxoFJJvy0NWOPiyVfSlvV/Uyl/OCO6Bl5MqrSsv7YKMG16umU O3JdbxsSOQV+qH9UZyTfCZva/cwfBmvsuWoJNV/ROZqkwb7WdFirR/AROGv3umnEuh6/ 0opQ== X-Gm-Message-State: AOAM5334aqbHu/3s1mwboKiTQLg71Zn5OqvtSbPnIGnzwvbJx7RtFS7Z 8tpmultPENb8egnS0G1jt/ijPorddaGoxKa6vpXOyQ== X-Google-Smtp-Source: ABdhPJwNk4rucNRhMj4yNyxR23IYIoZrXCIp8pm6EoX9xbxQdCfNsvtcJmUpDP+NMIvRS48FzA5FjJfl9ZbzBiCdh6E= X-Received: by 2002:a2e:8198:0:b0:246:e7d:45d2 with SMTP id e24-20020a2e8198000000b002460e7d45d2mr12632610ljg.495.1646012773660; Sun, 27 Feb 2022 17:46:13 -0800 (PST) MIME-Version: 1.0 References: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> In-Reply-To: Date: Mon, 28 Feb 2022 01:46:00 +0000 Message-ID: To: Guilliam Xavier Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ab8b3605d90a361a" Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: craig@craigfrancis.co.uk (Craig Francis) --000000000000ab8b3605d90a361a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 23 Feb 2022 at 14:00, Guilliam Xavier wrote: > On Tue, Feb 22, 2022 at 3:59 AM Alexandru P=C4=83tr=C4=83nescu > wrote: > > But when types are not considered important I think it's worth pursuing > > extending the coercion from null to the 4 other types where it's > happening > > right now: > > - int as 0, > > - float as 0.0, > > - string as an empty string > > - bool as false. > > > > Indeed, that could also be a way to solve the original (PHP 7.0) > inconsistency between internal and user-defined functions > (although PHP 8.1 started to take the opposite route...) > Yep, I'm hoping to find a solution that keeps as many people happy as possible, and improves the language. Personally I think `strict_types=3D1` is fine for my code, but I would neve= r want to force that style on everyone, because doing so would be fairly hostile for a language that's popular and well known for being easy to use/learn. And for those who like strict environments, I'm always interested in what `Content-Security-Policy` they use, because that's a really useful form of strict coding, especially when using `default-src 'none'; script-src https://static.example.com; require-trusted-types-for 'script'; trusted-types 'none';` and `Content-Type: application/xhtml+xml; charset=3DUTF-8` to ensure quoted attributes :-) Craig --000000000000ab8b3605d90a361a--