Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116752 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66362 invoked from network); 1 Jan 2022 22:11:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jan 2022 22:11:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DF7401804C3 for ; Sat, 1 Jan 2022 15:17:58 -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.6 required=5.0 tests=BAYES_50,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-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 ; Sat, 1 Jan 2022 15:17:58 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id r4so24005324lfe.7 for ; Sat, 01 Jan 2022 15:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:from:date:message-id:subject:to; bh=ioHIKk6mHnaHNjw+Y1e4spMw33QDmSJFMrO0RAkHHPU=; b=cDGu8ZOwSd7QT/GEYdAyZCqSJISRkrSKiYah2cOyNeqHuZUGo9wrmNwuEuS4L2ErSt xTIlThvVCuIZAMKyLT3vJRgfsQ74SoaE8iNHeAiVpB9rht6HktcIqOP+9OkHFnNDVCr/ qVjFsOUIbIuH/2h9tMNFJ8dK9aP0Xtl0Dz8F8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ioHIKk6mHnaHNjw+Y1e4spMw33QDmSJFMrO0RAkHHPU=; b=ObSCJUZ9x/XSB3KEOF9n2S5K3K+bD1esOP9BpJsi/NN+tnM4Iie6zDAXf8en4R4F1G hijXzWww1hYppou7D3hEY3TfiYBLAG39dJ/+7mokHCKv3JVd0Xa6Sup2j/XWABtocVpr 7fU+qWPjHDw5jo8g/su2Ir0jwcvBkarlWMapx+bl6ZXiCjnFCKQ2ivHTNiYIPVxrcUcI mczhmxpgg/ubCHX3Q5adM9JhpdTjX0RuzlcMdVLO3AHNR576SHyvuWPZ38bFW98i5uAs 4GZ2tlps/0shA3koR1uNWpUT8b9VL+ZqM8gTupR1kBdMLrcB2hLnfe5eXEwTzH8/Ah7x Njyg== X-Gm-Message-State: AOAM530Z3ExZianofucTs5frStSDvOcGLovw5FSuysOkjh0d5BdcNpSv NtWWSdNhZb9//E2AH2KHEwlkhxkUXz9MXTH6XvjRIQ== X-Google-Smtp-Source: ABdhPJzZQzYAF2FGxpZAD9iHGNV/rJ0BW9I+PgWpnCImMYdbzGu+kG0FKa87XLBnmEsDSK2eRbys+XZyIRyO8HQ0Sqs= X-Received: by 2002:a05:6512:2248:: with SMTP id i8mr36079683lfu.455.1641079076487; Sat, 01 Jan 2022 15:17:56 -0800 (PST) MIME-Version: 1.0 Date: Sat, 1 Jan 2022 23:17:43 +0000 Message-ID: To: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary="000000000000671c3205d48d7fb8" Subject: [PHP-DEV] Allowing NULL for some internal functions From: craig@craigfrancis.co.uk (Craig Francis) --000000000000671c3205d48d7fb8 Content-Type: text/plain; charset="UTF-8" On Thu, 2 Dec 2021 at 15:19, Sara Golemon wrote: > On Thu, Dec 2, 2021 at 8:48 AM Craig Francis > wrote: > >> Is there any value in me proposing an RFC to update *some* internal >> functions so they can accept NULL? >> > > I'm not hard against this idea. The interpretation of null in these > contexts as being equivalent to empty string isn't unreasonable. I guess > the only objection I could have would be an academic one and I can't really > defend that. So yeah, sure... why not? > Thanks Sara, I've spent a few days coming up with a short(ish) list of parameters that are likely to receive `NULL`. The focus is on making it easier for developers to upgrade to newer versions of PHP. I'm thinking of the typical developer, probably using WordPress, isn't using Psalm (at levels 1 to 3, with no baseline), and isn't using `strict_types`; where they don't really have the time to add strval() to everything that could be NULL. Draft RFC: https://wiki.php.net/rfc/allow_null And the list, where I'm proposing we only relax this requirement for the *bold* parameters: https://github.com/craigfrancis/php-allow-null-rfc/blob/main/functions-change.md I'll give it a few weeks to see if there are any parameter suggestions (welcome via email, pull request, carrier pigeon, etc), then I'll start looking for the best way to implement this. Craig PS; starting new thread, as I have gone a bit off topic, original one at: https://externals.io/message/116519#116556 --000000000000671c3205d48d7fb8--