Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121540 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71059 invoked from network); 31 Oct 2023 09:49:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Oct 2023 09:49:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EA504180545 for ; Tue, 31 Oct 2023 02:49:58 -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,FREEMAIL_FROM,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-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 31 Oct 2023 02:49:58 -0700 (PDT) Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-778925998cbso381834285a.0 for ; Tue, 31 Oct 2023 02:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698745797; x=1699350597; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zg4a3qLGW8N3B0zZL3+WMi7U/ZgbeVQbRQRveSpBl2o=; b=aSM7/rKXgFHADB6BSvKRnZGrz6L2lq2WdLmA+XQi5hvq0vrAiNdOlvrJsHh/ehignC XMPiN7ny8ijEA7Rx899Z5IT4NBQRtA/NHAollPeVZ2v7DsjGIJow3qA9T+9EOOIwUp7P PlXJloD/bmGo6jEJHJIEWZoFLa2rWxy6n5KnjKMP/KPQwrdu88xzvS7F8tKpoPYfwnCh +qRHrHTXredd7lBLBcOGzGhUiMc1YhlyUcAOeyVxXCcX8YqDg05ArNWVNItsur1K0x5c zL2UA28w5T35wWksoBiSFRrC/C8+QnE0tWxBC+n9vc3C9QVuD16R9h0VXaKyP27xDcJM p5MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698745797; x=1699350597; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zg4a3qLGW8N3B0zZL3+WMi7U/ZgbeVQbRQRveSpBl2o=; b=fkX1BxDgmAvEIJyMKLP4EpbAa/wBoF4/L8cyBKb99nzdxlTW5PpADzeu4zDYASEPcJ 8pcQ2v0mJDHqg43LAY7TF/+xfFmfHQIO1kF4uYf45lOZJqj5Vjknv3yvPC/V/eXH2VWQ fM5oTi5OmvQpFu91PwRFkVKGj85n5RDzRJBiBDSi5xvLzyr3uzNmSFExBXrk1K9tnjhg I+jkpBJJ8G47fwDG3uk/5am6rYaDeW3mVbjxmO7U5V2M4xLXFFCi0txR60+xKFBRv/iV dF4ZxYkEnVyuj7Kuv8Op5HKCVOHaZiPaRbxpz566w9QE3gWqMjlXxsuymwrVZIBhcBeP dh1g== X-Gm-Message-State: AOJu0Yyr3K59aW8LtmCQvplxgnCEF949qeCn+LvRKm9kWL7AOaUY0Lb5 6b1u/iUdPlfSVa6WIXxFM+F9cYK23qamHOsDUItmcnicbb8= X-Google-Smtp-Source: AGHT+IEXqBAoTiChY1tJInTvv2NpkccpPZ4rzLNkS2H+bT7lTrMOiuGd1Afdnl/7Vtx5iRItOJWRcstCOc79kp+Esow= X-Received: by 2002:ad4:4ea3:0:b0:658:997f:79b7 with SMTP id ed3-20020ad44ea3000000b00658997f79b7mr20076557qvb.3.1698745797553; Tue, 31 Oct 2023 02:49:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 31 Oct 2023 10:49:45 +0100 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000d3b3300609001366" Subject: Re: [PHP-DEV] New RFC : empty() function From: alessandro.a.rosa@gmail.com (Alessandro Rosa) --000000000000d3b3300609001366 Content-Type: text/plain; charset="UTF-8" Hi Mr. Tommins, thank you very much for all your very valuable advices. You can read a more robust discussion about my RFC at https://wiki.php.net/rfc/empty_function Regards, Alessandro Rosa Il giorno lun 30 ott 2023 alle ore 23:54 Rowan Tommins < rowan.collins@gmail.com> ha scritto: > On 30/10/2023 12:24, Alessandro Rosa wrote: > > I have posted a new RFC at this link > > https://wiki.php.net/rfc/empty_function where I suggested some > > improvements to the standard built-in empty() function and provided a > > number of examples. > > > Hi, and welcome! > > > First, regarding the clarity of the proposal. > > You have a few pieces of sample code in the RFC, but the "expected > value" comments don't actually match what that code would output. Rather > than inline comments on each line, I suggest you give the current output > of the whole code, followed by the expected / desired output. I would > also suggest replacing "
" with "\n", to keep the code smaller. > > Similarly, your PHP-implemented version of the function is trying to be > far too clever. If you want to illustrate what you think the rules > should be, you need a clear, well-commented function implementing those > rules. The first if statement, for instance, is just a very confusing > way to write "if ( $input === null ) { return true; }" > > Neither style of example really explains why you think your proposed > rules make sense. *Why* should boolean true be considered empty? In what > situation would you call the function with no arguments and expect a > meaningful response? > > > Second, regarding timescales. > > As documented at https://wiki.php.net/rfc/releaseprocess the official > policy of the project is that backwards compatibility can only be broken > in a major version - that is, the next chance to break compatibility is > in 9.0, not 8.anything. While there are often grey areas around this > rule, there is absolutely no question that empty() could be removed any > time before that. If anything, proposing removal in 10.0 might be more > reasonable. > > > Regards, > > -- > Rowan Tommins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000d3b3300609001366--