Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117503 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79713 invoked from network); 8 Apr 2022 16:37:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Apr 2022 16:37:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 037A01804E3 for ; Fri, 8 Apr 2022 11:07:51 -0700 (PDT) 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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 ; Fri, 8 Apr 2022 11:07:50 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id b21so16399300lfb.5 for ; Fri, 08 Apr 2022 11:07:50 -0700 (PDT) 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=BPRrYnzVgqwwCXKBRxVxrsST/JwXxsgU6J9/EQ8xup8=; b=ACsuXIHK/N0ubd2ycP71m0WGQhwSe/5LLGhFV8749Xsotf/jMQ9Pd6BgHhqDPuHx02 mKJ/zzAFI3blASJxpRn+ZqcFNYhaA2Bz0e3quVwoTMtRUHFRD01+wGpzrBuMNVVYrD1w tOJcCOWFxEiD6IujhNlro7wBy64BVZpkU6Je0= 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=BPRrYnzVgqwwCXKBRxVxrsST/JwXxsgU6J9/EQ8xup8=; b=BBx13tn/if7YS31MNtKYSXu18/xW6UunaZy6Gm7v0mgbXd6yjFe4cKCEAemuSJNHQg 0yRodIdr4GPPQxoTd4qWUQ4PIyvc+W4O6NRmBueg/8u3hgvGb2PkD5oDSJpnx8mwdtF8 WjnhK8m6n0tEb5IJB/j22GImFltE7KQNA/n5M2QnwNn+X7PWUhh7ji3TAa8nxbYICn7M qxs4N26pjxwsGOokPEghGVAdBf6XAr5OGdNxCN6Sc8hYCnX7xqPubGg8ruwELe4vkPbH o6/8szfD0lPgfTnASOwXS7g+KVEEIP3FyMtYXUOFecn4p6p3s0vSkahhi0SvzoTT6cwJ Y73Q== X-Gm-Message-State: AOAM533UaNG6hvF/LYHuROh8XNMIIVYSaPoXAgCpbcaM+z1f2DoSA0vH SF001RQH0FtQgCmLDH3oYKMfst/BIo6wMCIi8dZSp2m8v192lw== X-Google-Smtp-Source: ABdhPJx6IWaHLwbRGKALX3sAW9gapYCxaO1QJCVFm1lTdssZlBUN5OPfsT7IUcqINhiYvZSPffS2UfKlkYR81cWhVQA= X-Received: by 2002:a05:6512:1510:b0:445:cbc3:a51f with SMTP id bq16-20020a056512151000b00445cbc3a51fmr13635944lfb.116.1649441268761; Fri, 08 Apr 2022 11:07:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 8 Apr 2022 19:07:37 +0100 Message-ID: To: Mel Dafert Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000e7270d05dc2878c7" Subject: Re: [PHP-DEV] NULL Coercion Consistency From: craig@craigfrancis.co.uk (Craig Francis) --000000000000e7270d05dc2878c7 Content-Type: text/plain; charset="UTF-8" On Fri, 8 Apr 2022 at 18:54, Mel Dafert wrote: > In particular, does this propose changing user-defined functions under > strict_types=0 to accept null for scalar types? > > Eg., this will be allowed (under strict_types=0): > ``` > function x(string $y, int $z) { > ... > } > x(null, null); //no error, no warning > ``` > tbh my focus has been on the problems that have come up with internal functions. With user defined functions, I think it's up for debate (still a draft), but I think those NULL's should be coerced to the specified type (as documented), where I don't think PHP should be doing type checking under strict_types=0. Craig --000000000000e7270d05dc2878c7--