Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129584 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 lists.php.net (Postfix) with ESMTPS id 217F61A00BC for ; Wed, 10 Dec 2025 18:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1765390833; bh=QVSwpwJhuLIcufM0EuqWIK1Jln6OsoH4QYE4qyS/+g8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TP5ovFc9jZ0kGnhPtQGngLc3tLQGhRhjQbfns3G5B+zNMxO3QQr9zZMsVSdPHrWtW t0TxzQpv72MXA1ycF1vn0qnu2aU4T7YtM1t4foctPIVKXsRhKE7Qiyi3xcM3V4pvo9 wZdglZ6NekFUeX1kYyO1PwDrpXM2g1SEPs4dlS2exHkIFWpTqfAjo2CWY1O20k2Ow0 Sh8QDzKtqydatVk3qjiUvA21k0tko33tQdZe9MRnFKNrGI9tJFDqlXXL6qV0+QcVto 4eWN0G4OC6zxJ/Msz/rWW+3rJeM1Mozv07NP92SWtiMz9AFMy/TcutwPYtzaZ715vy pruY4NwkH7rOw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0BB221801D8 for ; Wed, 10 Dec 2025 18:20:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,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.1 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 ; Wed, 10 Dec 2025 18:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1765390812; bh=ZTkv0jrL9hZ68Jr5u258V4XanXcijf7dgJMloyqGBAE=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=GJYjunXJq3YqZ5kIhHlgsJXB9mdVbRRSg2yPtDDet9hDQjO8j76/lzfWUFYkcU2U7 GX3eE/MNCnXWfdzkoRgKyt9TfqPEoNwlnBFdpuhVbPfkuSTVd00/QQpZq0TQTK9O0s zKx4saGkXd54CkhunXw4VUOSLF//Qt2LivAJtLl8QSB6ELAuMI28hCH4EP6+NQvpy0 cox/ikRjXmbKYHjOKZts7rPXPOcxXB64JwcsZL+nB3wyoMi2WoLvv8bio81vqa2ouC 6zXTm1rUpEt91vXL4m7Ou85Wc/h33ii0pSKmNqccydy9w5EwmNAR13wvJbOns1OIDN nQkwICv/G9+lw== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 10 Dec 2025 19:20:12 +0100 To: Vinicius Dias Cc: Larry Garfield , php internals Subject: Re: [PHP-DEV] [RFC] Pattern Matching In-Reply-To: References: Message-ID: <3365205918df3aec7b0a77bd2f88cd92@bastelstu.be> 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-12-10 14:37, schrieb Vinicius Dias: >> This particular syntax was chosen as it is the same as in Ruby, the >> only other language we know of that has this functionality. > > I don't know how helpful this info is, but I'll provide it anyway. > Elixir and Erlang also have the functionality and its syntax is the > same, using the ^ character. > > https://hexdocs.pm/elixir/pattern-matching.html#the-pin-operator AFAICT this is not quite right. It is supported in Elixir, but not in Erlang. There is a proposal to add it to Erlang, but the corresponding PR is still open, which indicates that it is not accepted yet: https://www.erlang.org/eeps/eep-0055 It's not surprising to me that Elixir supports it, since Elixir is heavily inspired / influenced by Ruby. Best regards Tim Düsterhus