Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121548 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98767 invoked from network); 31 Oct 2023 16:36:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Oct 2023 16:36:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7D751180087 for ; Tue, 31 Oct 2023 09:36:19 -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-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) (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 09:36:19 -0700 (PDT) Received: by mail-vk1-f180.google.com with SMTP id 71dfb90a1353d-495d687b138so2409601e0c.3 for ; Tue, 31 Oct 2023 09:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698770178; x=1699374978; 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=52zea0WhK/kEK/zset9SdouVS74j4qjiuppP3lpF/p4=; b=hdUTZdLsATrEg2+Eo0X0hHrrc8znX6VfLlHabcSqAxGjQKjIUW/ODUJiSrKaS8it2s FTC5VpwWelGqUh9npE2avNmQFTkRxbiLkg2815Yi5uMk6EmquPJ4/N84TH4+STtcyona cvyYIoyYSA4m7vcBFWWztA/jbd2iiaCWqHMzo5UXD8p3OK/cUArl3nkCE+bJnWiVQvur Bt/heuPdR/JBeFTL9Hy6a3cvAvSmXdpBZpnaZWxvT1YSGVlZdzhN5VEwUzIkGw7khNna 02Dfr5MtWo6iKHkgyccSp4ybX++4KSl/mAWsEWWGqIrUn+t3nlIJUXRI2WGng6Mjo2Lm +j+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698770178; x=1699374978; 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=52zea0WhK/kEK/zset9SdouVS74j4qjiuppP3lpF/p4=; b=u89hx3cZDfHZkRePpCRja49NLnmD7+dGmy4Ln7XnfIHPeK10iypqrYaJ+34ZVZUHef uWXrwda1rkRQEvl5b0W3tFiveZ752V1qVAaZYFRpcfH5IJcqbUoWC9vrHZlRso8nJh2l rayls1iGYpMo6doYTnaPkf0hA1DiW98hNHkd3EjRvBEXHYHvqZBcCG4rk2rE7pp7K29f NsIQ5endy9mj3TDZojr58a1UR8SAos4gRYP5aK8W9EUxIE1yskiwRU69lXp9K/oKmkp7 Yq8+g9a6rNmrFfiBDHjpAIiqdAEiiWkbO0jPwi/pTRmm1HQYEb6cdWmwAbgM5W/yvv2z u4pQ== X-Gm-Message-State: AOJu0YygqwZOBQrmrRyncxUZAFDPZA6ctFTD0rWW+MRFUbkyxRJrEdLn 36uPouV7YbMwVJHOxaG7jQBqcKyHFCMO9xQ9V18= X-Google-Smtp-Source: AGHT+IG44+ciwhxVtT7IjKTY+o5DxBcRsxvo1Dzn5e4p1P7Rfv0kngNl4/YCO/4F+hlwGcOdQeXQY0Clo/IQniBMbIU= X-Received: by 2002:a1f:7c04:0:b0:49a:b0ff:eeaf with SMTP id x4-20020a1f7c04000000b0049ab0ffeeafmr8410564vkc.1.1698770178216; Tue, 31 Oct 2023 09:36:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 31 Oct 2023 17:36:06 +0100 Message-ID: To: Brady Wetherington Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000071e85060905c179" Subject: Re: [PHP-DEV] Re: New RFC : empty() function From: alessandro.a.rosa@gmail.com (Alessandro Rosa) --000000000000071e85060905c179 Content-Type: text/plain; charset="UTF-8" Hi Mr. Wetherington, thanks for appreciating my proposal. According to the contents of my RFC under discussion, I suppose my version works better than the code you presented. The RFC contents do illustrate the details of the performance as well as some examples have been included. For what concerns the implementation, I __just__ suggested deprecation. Both empty() and is_empty() may co-live. Regards, Alessandro Rosa Il giorno mar 31 ott 2023 alle ore 17:08 Brady Wetherington via internals < internals@lists.php.net> ha scritto: > > 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. > > Is your "is_empty()" function equivalent to something like: > > function is_empty($param = null) > { > return empty($param) && $param !== false && $param !== 0 && $param !== > 0.0; > } > > If so, that might actually be kinda nice? I was looking for something > like that the other day. > > Regardless, I wouldn't do the BC-break; I'd be more inclined to (very > begrudgingly) leave empty() and warn against its use, and have > is_empty() as a new thing. Maybe for some future deprecation or > removal? > > I also do like the idea that someone else mentioned here about being > able to possibly start to get away from @'ing variables with a > solution like this. > > -B. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > Il giorno mar 31 ott 2023 alle ore 17:08 Brady Wetherington via internals < internals@lists.php.net> ha scritto: > > 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. > > Is your "is_empty()" function equivalent to something like: > > function is_empty($param = null) > { > return empty($param) && $param !== false && $param !== 0 && $param !== > 0.0; > } > > If so, that might actually be kinda nice? I was looking for something > like that the other day. > > Regardless, I wouldn't do the BC-break; I'd be more inclined to (very > begrudgingly) leave empty() and warn against its use, and have > is_empty() as a new thing. Maybe for some future deprecation or > removal? > > I also do like the idea that someone else mentioned here about being > able to possibly start to get away from @'ing variables with a > solution like this. > > -B. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000071e85060905c179--