Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127066 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 A5B071A00BC for ; Mon, 7 Apr 2025 07:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744009937; bh=39D8+bV4yxlGCgihASVZYLCB/jTW6EDe1kVBMyTeNb4=; h=Date:From:To:Subject:In-Reply-To:References:From; b=EmRVEZsBatQY+5rQ/FZakBtykFd7S/92vHi3Qk8+N8kubPrIFxgm9VMPZBTKrGAQ9 QQnl382hpG88QGQ/BlKUlogDEmGZ+BhJ2q3bCGbviw5nV8P7WmbssJdSCzr3EwSnt7 qha/A2E8OMqE2KX94tcNsZ0Q2yRrcNZcUBX8CwrBbSWlfjA/qyQZua35HtV4pCPvzX x0Toj0/vfTPmV/EpCHoYMJUEpJzx6ky72kSFOZfZ3uje7nGsz7nG/3SK0ZPdTnmSF4 ubvSgceXZf3zQel6pM6qER04JhY+Fgin7osTxJlMAVfKqRQ1Rke0rwegrSmv2vbqwh qsh+e7guQzZbQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6F46D180077 for ; Mon, 7 Apr 2025 07:12:16 +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=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,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 fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (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 ; Mon, 7 Apr 2025 07:12:16 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4D3BE25401F3 for ; Mon, 7 Apr 2025 03:14:40 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 07 Apr 2025 03:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=fm2; t=1744010080; x=1744096480; bh=39D8+bV4yxlGCgihASVZYLCB/jTW6EDe1kVBMyTeNb4=; b= Cx7tdebubaL3YDrBNyNAljwpAWWJMotQBlQ4Jfp65n1jeCdRnlEc088aEMEQCdqT lnB/IukEecqInTSaPe+yxZFNP/nNVtWQmfZS2oDUmulGzoAXpRGFmnKfvsHnOqf8 zP4fsVqmdFPhSsqZ5iEJvsNPyE1JuFMEOgS5UT73z9gTroiG80wQRLh7LQV9O2zh QZvcbw47PUMCQjXR9MsZzmTXkNuwj0Xu1l0W4ZBcnp2wTpLJsp8qJPKF3pBue7Kc bkROjSN9sLzkbQokdGsLf/lmVtGFhr3f3yafKmvdskVcbBd5x1eIR7oqT3iu0HJq wzMAeCf9mvYW5aYWIBJVNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1744010080; x=1744096480; bh=3 9D8+bV4yxlGCgihASVZYLCB/jTW6EDe1kVBMyTeNb4=; b=eyWUgsos9edU0Yiay 40HGnRE3n5r9Uf/TJeMzibfn46QvIvKA1zk0u2GBe7xoCERWVWui+VJPfNihglkR PiTCXUINkiR5mI6xojdcPCmBHndzmwrznXn8kJ5nmh9WjpSI2sor+C7Fod/Vl2ay UMOj77ME7g7lq2NMhciUhafLSSIj+Yl24tNsgCifWEwJXdeiq4YRD0q0GGIasZ4i fqQUdyHFr++ex2tK9IAry7kzrgM4iDkG36o1gNdTxn4BqmnOsVRT1GB1K1Z6Ghdd uGcNDSCDHgz9RW2N2iE0YBgfDg36ZGEpAJtJrWiZA3iU6L7KVMk+FwmN2F8KuN0D BwPTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleelheehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeehkeetvefgkeeihefhuefhkeejjeejieejtdetueeigffg hedviefhffduteettdenucffohhmrghinhepgihktggurdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhif vggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 7 Apr 2025 03:14:39 -0400 (EDT) Date: Mon, 07 Apr 2025 08:14:38 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] RFC: blank() Function as a Complement to empty() User-Agent: K-9 Mail for Android In-Reply-To: <17aa0250-ee1f-477a-a255-303281d7a833@app.fastmail.com> References: <17aa0250-ee1f-477a-a255-303281d7a833@app.fastmail.com> Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 5 April 2025 21:00:15 BST, Rob Landers wrote: >I agree with most of these=2E I do not agree that " " (a space) is blank = though=2E For people without last names, this is often their last name to p= ass validation on forms=2E=20 This is firmly into "space-bar heating" [https://xkcd=2Ecom/1172/] territo= ry - failure to trim whitespace before validation is a common bug, and requ= iring a name in exactly two boxes is a common design/localisation failure, = but neither justifies the other=2E I think a function for "string is zero length or contains only whitespace"= would potentially be useful, but am not convinced it needs to accept any o= ther type, or have the error-suppression power of isset/empty - adding ??''= inside a function call is not a big burden for new code=2E That said, I just realised there is a ctype_space function, and I've never= used it or seen it used; normally, trim($foo)=3D=3D=3D'' (or trim($foo??''= )=3D=3D=3D'') seems to be good enough=2E Rowan Tommins [IMSoP]