Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127128 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 8F2271A00BC for ; Thu, 17 Apr 2025 07:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744876607; bh=4P8qF9yqmHW34nbSIdh8m2XjjsRSQii1SyQa7/Oewh0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hwu6f+Mi2sKiMBACpuxciK6m6CorMANvzsuvhD0onlpnpNQ+Mh3vm144bHeXuihnu O6RjbazJEohC/A3TC1WjCmjqih0FQzybyOf2EY5k3S3cC3mwbl1LB8KHJJgC+rEo+V djgrFWQtwBLWrh50jNn9+LLrqbRBpejKjpjE9ZEv9kVQTNqduuq5ayj18IY+yoUrME PCrQPowJd7twfKAwLnLLoeclVfr3zZ19OTModfAJ1gkFVqSGY0Za9OID+oYcr/voyp cAcNt3jWza7YvYK1Fp0/Zy8BTgjGrmBPXN3ENVgek9K8+/ufVL6xLhPAJWpDrgJdwc iZE1iBGGQN/0Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 41422180052 for ; Thu, 17 Apr 2025 07:56:47 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Thu, 17 Apr 2025 07:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1744876747; bh=RUqQeh54sT+cuWXuNC9kMQh2yL1s4ruGGzmPlNkYeL0=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=jIooPRpN+9eYrEVBl49WMfGa67aaRZI9HPHGuqz+a4MltE1RR7CqVLCF0bRKG/zqw gY82sysSzw3uCY3G+Tof8Ov+qV0xfLVKG5Et5HktWzdPG4jJcR85Jvz/yg2EUEgwOg X7qJFdkpdFi5EUs3wdrHh15HrPt7r3Z/LdtrrcTHs55anfTC9TCDHn6qFb64M3s7QD YqPtuR9qfkhBZKpd9rCFW79heeJjecwwE4FpYV7cfujHRSRzUZJhAmGkqfOwRY+kbG gM40Ro6c1zjL/wLu2agOxzzF0nKzN62gZXoVfrHa2XMS30GYYyRaK0iI5P2xSzM5GX Ey/7VjECZ34gQ== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 17 Apr 2025 09:59:06 +0200 To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Subject: Re: [PHP-DEV] RFC: blank() Function as a Complement to empty() In-Reply-To: References: <17aa0250-ee1f-477a-a255-303281d7a833@app.fastmail.com> Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-04-07 09:14, schrieb Rowan Tommins [IMSoP]: > I think a function for "string is zero length or contains only > whitespace" would potentially be useful And for that one it would need to be defined what whitespace is. Is it just the ASCII whitespace characters? Is it Unicode whitespace? Is it also Unicode non-whitespace that renders as blank? To give an example of the complexity here, this is a `trim()` function that I implemented to handle all kinds of “blank input abuse”, while trying not to break legitimate use-cases of non-Latin languages: https://github.com/WoltLab/WCF/blob/5c6568807aa22ce337e7527f75c7a8fb2047bf67/wcfsetup/install/files/lib/util/StringUtil.class.php#L90-L141 Best regards Tim Düsterhus