Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117553 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69814 invoked from network); 20 Apr 2022 16:15:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2022 16:15:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 26828180510 for ; Wed, 20 Apr 2022 10:49:35 -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=-2.1 required=5.0 tests=BAYES_00,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-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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, 20 Apr 2022 10:49:34 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id w19so4301968lfu.11 for ; Wed, 20 Apr 2022 10:49:34 -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=6h2M5HrIbOS3qYoW3r96zF/v1rY5oP/+NsOC/zL11Wg=; b=jGad1h7NOBNYuBeKdstZzPKCak0NGKk54RLz+U/tE5hlAi9tQ4PfgNy3PI7oHa8ziC Q9STdB0hK1kH/I5lgw/01R02TrQMAGT2tE8yvAol4EY878Rn72ZdbZpLhhEwL85W1rNt 32UqipL3KuH1ZUIk7Qk7uQR88D+4Dbr6yZlYg= 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=6h2M5HrIbOS3qYoW3r96zF/v1rY5oP/+NsOC/zL11Wg=; b=pg+VoLZ8wTv0ZnDzHhJE7MaEmx92PV20mQMNJlbGYZZfwJlQJRnUmYNxKpbpi8NYcs mGd4UbSVrl4556gsjb1Snq2c88smXJoo80DcLn4wuZMDd7OfMKiMRrkICZ46FN/rvoXc DGRR7qXwWn7UNJN44Ru/SgNjtHuxqFfrRsd/Bggv3pK/M1eHRFlbHyXQyD6jKe+5T4EX RkOx2O2qUzG90FfZfE3QW9bftFrYUJVDJNyFeQSDuHvrfbmwQLG65twNo8TZCbrwu7HD HhM4zMN9jX0FKrQ/4KzDYWIpwwfQ0EHQEgUw4ytOIMXG5Ps8WkSMr7XH4rUfAjGBU8Bp kWSA== X-Gm-Message-State: AOAM531Qvzppac+XGvrni07RdSLOlJ7tDw9dOAAxL5HxUedFkGcrq2t8 i5s7iPwlbBkrnRcVmELV4yaalnQ7FsBQ/BhXSGHbyQ== X-Google-Smtp-Source: ABdhPJywRHv/FSczUuQ+nHV050qQuvX+22qyxgy3dRUIB7xkMPu725gv0nt9rNyvZPf330+Q5mzxZIeFvtUZaaZk804= X-Received: by 2002:ac2:4203:0:b0:448:8053:d402 with SMTP id y3-20020ac24203000000b004488053d402mr15028358lfh.687.1650476972802; Wed, 20 Apr 2022 10:49:32 -0700 (PDT) MIME-Version: 1.0 References: <42D0A480-F262-4F72-9C4D-887762A8D800@gmail.com> <0b061f28-a087-efd3-8602-424ee03458e0@gmail.com> <885e9419-15fa-fffb-5d6f-7427705a0400@gmx.de> In-Reply-To: <885e9419-15fa-fffb-5d6f-7427705a0400@gmx.de> Date: Wed, 20 Apr 2022 18:49:21 +0100 Message-ID: To: "Christoph M. Becker" Cc: Rowan Tommins , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000ac9b7305dd199dee" Subject: Re: [PHP-DEV] NULL Coercion Consistency From: craig@craigfrancis.co.uk (Craig Francis) --000000000000ac9b7305dd199dee Content-Type: text/plain; charset="UTF-8" On Wed, 20 Apr 2022 at 18:26, Christoph M. Becker wrote: > Null is *not* a scalar type[1], though. This is the reason why it is > not coerced for userland functions using *scalar* type hints with > coercive typing. > > [1] > But why not? and how many developers actually care how PHP has defined a scalar type and how that relates to coercion specifically (and only) with functions? Bit of a tangent, I could argue that NULL is closer to a simple string/int/float/bool, than a complex array/resource/object (well, an object without a __toString method)... or in other words, NULL is a simple value that is coerced perfectly well in other contexts, and has been coerced for internal functions since, well, forever. Anyway, the problem I'm trying to solve is the backwards compatibility issue this is causing, and how it will affect upgrading when it becomes a Fatal Type Error... if you have any suggestions on how to solve this, please let me know, for now this is the best solution I've got. Craig --000000000000ac9b7305dd199dee--