Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123712 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 7AADD1A009C for ; Thu, 20 Jun 2024 21:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718917623; bh=3+XkBm96TTiGOb8JizlB6qrblfpORknJPGT7tHcLvMQ=; h=In-Reply-To:References:Date:From:To:Subject:From; b=NK9FbdFZ+BhKkhmo6kk8ePhnjB8dpdvgJHDHvXd2MJtw+eK+SoLudMdH98BI1oyTT ifMNsnqSqvqgAOC+dCbUlW4OPoM2Rgw993K92o4ULmNFMYsc9U1dDBKv6UVUZIWFgL V4n7y5FKblPiFaFv6AKNIqqmCey5BOG7g3uCcMYNIJNGmiQhVu5g5A1eDTMjoUatdq 3nzJ36HPR5/wEOftoDuEGnXaf+EYr0gAO5NzVwOvDWavYM8eAr7xffJajo3Jig7XVv BYhR6yhCHyAjJNpZwURq60e8bLQ0gkkmKlOgVTXM8EtaFLwignTZa5MLkrgHRcioZl BaLzeetZsGYdQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 70804180BF1 for ; Thu, 20 Jun 2024 21:07:02 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from wfhigh2-smtp.messagingengine.com (wfhigh2-smtp.messagingengine.com [64.147.123.153]) (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, 20 Jun 2024 21:07:01 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id E8504180010F for ; Thu, 20 Jun 2024 17:05:46 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Thu, 20 Jun 2024 17:05:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=fm2; t=1718917546; x= 1719003946; bh=M4/AtGwTNSfqwXvS8Ktn2KvF6smXL7OK6d8nB4X+pVQ=; b=S JFNGgTOpOlyNqPPy/BOL7WR3JC0YeFUOFihZqZ32cvERiwWsEZAcuC8nKs//nATj AQbs3kwte0xtIX3L3Owvs1SAPhuPHLW+QUxHxexEmmFzYneacvZQsMwxI6HUHKJ+ S0v2w61bcOyCcbDmibvVIn3ISp4vugv57SyN4ottEL0jvRmRFzBVl3p6SXDwZB7O sjN7TFpIXduHpRGA1OEgxKMy7Sopfl+dcoLv9tJNbUyvx1YxLpYudIw9IQvwjWCw a+ZL2gd2lpfr1jhgRkLqnFawRZQAH3a3unXknN1506adfgPULOw4Ie86oM7q9n8Z y3gCbL/c9y5fhk2adh2XQ== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1718917546; x=1719003946; bh=M4/AtGwTNSfqwXvS8Ktn2KvF6smX L7OK6d8nB4X+pVQ=; b=WrmHzjX7r4uwC4i2KyiTvwrzEWj80TU+vnHX08MlAvxb R9cCWJOvfkX0kSyDwW06d5gyqJq0CqzBk2vLGJL0uG8w7vvKCwyOV3KkQA985rax 8hFglBrbEDiWvDBXCAHV+3YXYubxsw6KtDwNUkiV7wcob+jFr6HaF3DPi+VBZ2LT XSoHQFZngSzbPQe+cWkq3ixvm4KZ0oJBXUatO/TkwrqwMosKpFJdm1WkBWzilFAL 9JHAp4vdF4ndip9Y/aInIC30ICGOdFDul/5jsgw5HAHAwe8WbcgKxc4UzAlnOcMU nuPLdvcBenN6eAVd1qTjGPGXxV1JWFae+rS5R9y37w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefvddgudehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepveehhedvveejledvvefgleevffdtjeekledvkeeg heffgfeivdejhffhledtudetnecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhf ihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 207AF1700093; Thu, 20 Jun 2024 17:05:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-522-ga39cca1d5-fm-20240610.002-ga39cca1d Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: <1956529224.315730.1718915368970@email.ionos.de> References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <1956529224.315730.1718915368970@email.ionos.de> Date: Thu, 20 Jun 2024 21:05:24 +0000 To: "php internals" Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jun 20, 2024, at 8:29 PM, Thomas Bley wrote: >> https://wiki.php.net/rfc/pattern-matching > Thank you! > >> $var is *; // Matches anything, more useful in the structure patterns below. > > maybe also consider: > > $var is mixed; // Matches anything, more useful in the structure patterns below. :thinking face emoji: That should actually already work naturally through the type support. And should indeed match anything, so... maybe we'll drop the wildcard and just document to use `mixed` for that? It's a bit more to type, but should be pretty self-explanatory and eliminates a syntax, so... We'll consider this further. >> // Array application, apply a pattern across an array >> $foo is array; // All values in $foo must be strings >> $foo is array; // All values in $foo must be ints or floats > > +1 > > Regards > Thomas --Larry Garfield