Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121537 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 41459 invoked from network); 30 Oct 2023 22:54:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Oct 2023 22:54:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6880E1804D0 for ; Mon, 30 Oct 2023 15:54:36 -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, 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-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 ; Mon, 30 Oct 2023 15:54:36 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-409299277bbso31694215e9.2 for ; Mon, 30 Oct 2023 15:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698706474; x=1699311274; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yAisORbrP8qrHvqY+8tJB/BesyWq9uZyBG1Yk9hM46U=; b=bhHtmO5c1tEw8dgK6wTnii9XrlKW5jQfdKWm2jvsdGCnQxq/7zysLa1NYzCWl7ADVH W0tLX/NChGLVKm4dn4YFcfl46UKviLOQzOytPSMuEyu8KIAQf+CYvE+OUFlTaf2b08f9 hGQTophZ3g5EUtxp114lou2IdDBLg5BawIRPRtfe2WcM4f+0m/J9h+6y537TOCw4Ge0R tZjRl8IRpO4w2pxHq0HT1fJwYNbE79a9L3shvrRVw+oHvdHbKLe5S5lXri4IWsIT+Y+8 4muautJg56mf6RuwlnzqdWLrHx0eMiLM21vXa7PdAJZteYPE7IFDKQ7VqZ72UqMfO9Wq Ez5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698706474; x=1699311274; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yAisORbrP8qrHvqY+8tJB/BesyWq9uZyBG1Yk9hM46U=; b=YUIj62eLquBcz6CBk0G1QxpHkgluGwC+HxxpyKvUtwPAn9dVY9iDdYPMXyHYNqK2mv S00PkYhkDYM9hYt89qvrzmsHOFyIRa4P5UDdqYoqW4bZB5Figxg9TIn9MLGx1brF5RCx v/9FlJZjea0xdwW0NXMY/X014kq2PmbBX6W3yyjGGD+FofTV6m7anbWfVWJfdCZDZL/u MOkcTZH1DJwjbBVUxNzCZOGQwJZaSjzXsNbuJxJaGq92XnMsAi8/qR6C8sxF4aOMcuoz ozaDmw9CQjjvoxTbwdPGDbYdOMVFkcXy7Y7Vb6BY1s84Y17INIBMrTBM2skYdB9YBPUP fiBg== X-Gm-Message-State: AOJu0YxwhHg6jk4hq6qMCpWh4ZYER3eW+pezXrGo5P7EevyaO9PGeFS/ PssNhudJdrK0wjD7YcCjP2qMX4eI0xw= X-Google-Smtp-Source: AGHT+IHHyxuKV4/BOZanjRfyShbpcCqmG8Jcz5UwOkawtvFcWgzMl5fM3zNZ0M2rXXVrmV70CG8KeA== X-Received: by 2002:a05:600c:3148:b0:401:bdd7:499d with SMTP id h8-20020a05600c314800b00401bdd7499dmr9644979wmo.25.1698706474380; Mon, 30 Oct 2023 15:54:34 -0700 (PDT) Received: from [192.168.0.22] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.googlemail.com with ESMTPSA id u17-20020a5d5151000000b0032326908972sm59651wrt.17.2023.10.30.15.54.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 15:54:33 -0700 (PDT) Message-ID: Date: Mon, 30 Oct 2023 22:54:30 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] New RFC : empty() function From: rowan.collins@gmail.com (Rowan Tommins) 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]