Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127056 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 6BB441A00BC for ; Sat, 5 Apr 2025 19:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743882305; bh=KY7swhAyXDwKOT0ktVOlOJVjmBnVDUhuipBHZ6CL+sE=; h=Date:From:To:In-Reply-To:References:Subject:From; b=GCwniLIg77yxp5o6TO9bZw/C1yClGn8wQ/zzAy1l0+pSnQze0GcVCKcXlgyIrz/W4 w4U3HhdgMDCmqi3UmWOuHB8Goxmko+SKdl1lyBVC4ZwXiLuUKiXlahHTuq7FdEBcnF rra2CGPynZRKCOtlw+Eoz8y3c0+ZfuRsZH89RhtBrCqGTA4FJMBwu/Q5klPxzothdh RAUApUov+nSmOC2+jqXkp1JwSbOtXz27O/0iWGvFUrNyHpNNP+t6Nr80xS6IyCQe8r LbKkxTUWxxuCIUk+SrtNQy46iWv0ZbRP8cGT80c62+GfT0uPecxz4UbyMdXq4Ys618 8hJJy2Xezjy6g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E654E180053 for ; Sat, 5 Apr 2025 19:45:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 5 Apr 2025 19:44:54 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id CAE5F11400BD for ; Sat, 5 Apr 2025 15:47:19 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-12.internal (MEProxy); Sat, 05 Apr 2025 15:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1743882439; x=1743968839; bh=29H9xBMbeL Qu6eNYTEfN4MO9Ms5btzSMoloSeZK9cyw=; b=ai4Esdpc9MvBw2714KGDD5Bswj cCQLOoPz+AbatTBZHGHuGzfi9Yoz5hvAX1StBsU7UOUENt7oxYbS9b5qV/yuVsny XXU4bvJpzjJJhEVDlWsqyxA2/Y3/2ascAA8zYIpzNC1tUQ6250ORuIP4xLVAhk2H h1VnvyYZqo4LgyzyAZpeOw6GwqMFF00BZ0qsmzmKR9ke8wptIrGs961K3b1YIhhn 6oRDNTMJycVcNQBcFB789aqiAMgkydMZRhSyIX4zamV39xaeQ8DHfADDbBICoU16 eUzR6m4OG1sUwlxlKLnkSliN+eXluCd7Rss/BObj1UBe8lJ8mljCwOaCsgUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1743882439; x=1743968839; bh=29H9xBMbeLQu6eNYTEfN4MO9Ms5btzSMolo SeZK9cyw=; b=CX3t7M9gZ6+0E1csd9p55XdIxYa+wVbHnMwRrFBX4o/D4r+B/tR Fj8iVAmwDULz3I30qhPo0zc/HH1RR0KUFiG6zVKuqUjzUGVdktBUPjmZqeuq91ae ZudlR61Rci20Hrfe+fLlVFKeWBeSOqtEQ4HPhMpFflvwUSrG47VUMBbRKsswImIe BVMiPpb6tkDvQEelJpxyWTLteiOcCaFId03U6csQrE0K4idtHeCQR4bBsYYh76GX F2ewFv6g0WM7nSiAoN8ZEZgfFpyVl2gTexdug92DcU/V6WcStBtUtthPBWOdT3p6 O03330kEL5Jm43TNDxtZ0xKHvYwCP8zd3nQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleehvdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhushhpvggtth ffohhmrghinhculdegledmnecujfgurhepofggfffhvffkjghfufgtsegrtderreertdej necuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtg houggvsheqnecuggftrfgrthhtvghrnheptdeitddvvdevhfdufffhgeelffetgeffveek heekfeeluedutdeiveekvdetjedvnecuffhomhgrihhnpeefvheglhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohht thhlvggurdgtohguvghspdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 575F5780069; Sat, 5 Apr 2025 15:47:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Td40fe37c6836e36c Date: Sat, 05 Apr 2025 21:46:58 +0200 To: internals@lists.php.net Message-ID: In-Reply-To: References: <68e5b45e-1ae1-452b-9b4d-788e11c8cfe1@scriptfusion.com> Subject: Re: [PHP-DEV] RFC: blank() Function as a Complement to empty() Content-Type: multipart/alternative; boundary=f9c41072ce944f64844adb56217ee26e From: rob@bottled.codes ("Rob Landers") --f9c41072ce944f64844adb56217ee26e Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Apr 5, 2025, at 21:23, Bilge wrote: > On 05/04/2025 20:18, Rob Landers wrote: >> On Sat, Apr 5, 2025, at 21:10, Bilge wrote: >>> On 05/04/2025 19:41, Rob Landers wrote: >>>> empty() has very many uses. >>> That is exactly the same as saying `=3D=3D` has many uses. It does. = So many uses that it's useless. Its semantics are nonsense. >>>>=20 >>>> if (isset($var) && $varl !=3D false) { >>>> foo($bool); >>>> } >>>>=20 >>> >$varl !=3D false >>>=20 >>> You should never be doing this. >>>=20 >>> Cheers, >>> Bilge >>=20 >> Heh, to quote a great movie: That's just like, your opinion, man. In = all seriousness, there are quite a number of uses for =3D=3D, especially= because we don't have operators on objects, nor do we have value object= s. Sometimes, equality isn't based on identity, but on value: >>=20 >> https://3v4l.org/rRMNR >>=20 >> =E2=80=94 Rob > You don't use empty() on objects. >=20 I initially thought your comment was focused specifically on the use of = =3D=3D, rather than "=3D=3D false" or "!=3D false." That said, I think a= ll of these have valid use cases, as does empty(). I'm not entirely clea= r on the point you're trying to make, though =E2=80=94 if the argument i= s simply "you should never be doing this," it would be helpful to unders= tand the reasoning behind that perspective. Without context or elaborati= on, it comes across more as a personal preference than a technical guide= line. =E2=80=94 Rob --f9c41072ce944f64844adb56217ee26e Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Sat, Apr 5, 2025, at 21:23, Bilge wrote:
<= blockquote type=3D"cite" id=3D"qt" style=3D"">
On 05/04/2025 20:18, Rob Landers wrote:
On Sat, Apr 5, 2025, at 21:10, Bilge wrote:
On 05/04/2025 19:41, Rob Landers=0A wrote:
empty() has very many uses.
=
That is exactly the same as saying `=3D=3D` has many uses. It=0A = does. So many uses that it's useless. Its semantics are=0A = nonsense.

if (isset= ($var) && $varl !=3D false) {
  foo($bool);
}

>$varl !=3D fa= lse

You should never be doing this.

Cheers,
Bilge

Heh, to quote a = great movie: That's just like, your opinion,=0A man. In all = seriousness, there are quite a number of uses for=0A =3D=3D, espe= cially because we don't have operators on objects, nor=0A do we h= ave value objects. Sometimes, equality isn't based on=0A identity= , but on value:


=E2=80=94 Rob

You don't use empty() on objects.

<= div>
I initially thought your comment was focused specific= ally on the use of =3D=3D, rather than "=3D=3D false" or "!=3D false." T= hat said, I think all of these have valid use cases, as does empty(). I'= m not entirely clear on the point you're trying to make, though =E2=80=94= if the argument is simply "you should never be doing this," it would be= helpful to understand the reasoning behind that perspective. Without co= ntext or elaboration, it comes across more as a personal preference than= a technical guideline.

=E2=80=94 Rob
--f9c41072ce944f64844adb56217ee26e--