Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124793 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 82D6A1A00B7 for ; Tue, 6 Aug 2024 08:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722932367; bh=cQ862jl/FK/+ip0Uhrsqn+EIZXpyUFwwXwoatr+vJgk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TRvNvambOnD/QpoqnSg8vklhKfUry39Vz7aVKXd5tYcr1LecdJIYN1gW87hHxzGhY wvCN1Fuo2rLJTkrByBOxrP3CvNlYcPyPm+iY4SmluQEEhph2UtPLm3VCKII+zAt4Ru YGae+62Qt/eDkNz8lk0SjdD+/DHOSszJO3kFyP959O5l6757uE9beY+rzjWM/6mLe+ 0YvqwbT03kkgMHK5Lb+2oCIO4j84hZt61duWZ2LHh1izcJKTC/8aRjUde85D4WevGi Gn+zOTSQm2hAbi0ZToRjKMP4BcnROjEk/QGWGQniADizlCe0vnPpPMAsC+mMS3oBeN 48zKG8klq5ykA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CC19C180077 for ; Tue, 6 Aug 2024 08:19:24 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 ; Tue, 6 Aug 2024 08:19:24 +0000 (UTC) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 09E641A0635 for ; Tue, 6 Aug 2024 08:17:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B41DA5FA72 for ; Tue, 6 Aug 2024 08:17:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1319D1C22CDAB for ; Tue, 6 Aug 2024 10:17:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chilliet.eu; s=dkim; t=1722932260; h=from:subject:date:message-id:to:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=cQ862jl/FK/+ip0Uhrsqn+EIZXpyUFwwXwoatr+vJgk=; b=snZwlNfILH0F4l5ymgnQfJoKtolnkbg0atE2KnbGv7teXJC9l2Sd07bwSQGHB2DQc/IrO1 izDpk6/ZIejLG1zobQlovvNWByr75DYuJhYIwz2hPbwPIHL+Bcw6FNOs4cix9G9iltj8KM jSQdKF2b118Wt6OSKkffLY3dGl7/osQRPH/MvU6eTgXGI49Ng0HlV+Wm+0ypa64KWPliuv atAfmmRliCwONJxeFKgzMtlStu2kC626wDj/hgkBj+91r0XnRf9kJjRaYZ70Q3eXJxOcne 63/19xhqmmgGeP6KGttpIly+Ik8woxZIeOhQksYLdeTgZtUi2INuW0fm3kZXvQ== To: internals@lists.php.net Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Date: Tue, 06 Aug 2024 10:17:31 +0200 Message-ID: <5803627.DvuYhMxLoT@come-prox15amd> In-Reply-To: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Last-TLS-Session-Version: TLSv1.3 From: come@chilliet.eu (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le jeudi 20 juin 2024, 19:38:40 UTC+2 Larry Garfield a =C3=A9crit : > To that end, we're looking for *very high level* feedback on this RFC: >=20 > https://wiki.php.net/rfc/pattern-matching Hello, Thank you for this RFC. Sorry if that=E2=80=99s a bit focused on syntax, but I=E2=80=99m really con= cerned by the binding syntax. I would totally expect both these codes to do the same thing: ``` if ($o is Class{prop: 3}) { ``` and: ``` $x =3D 3; if ($o is Class{prop: $x}) { ``` I=E2=80=99ve seen someone else in the discussion propose to invert the logi= c between binding and use a variable and I agree, it=E2=80=99s the binding/= capture which should have the special syntax. Either another operator than ':', I=E2=80=99ve seen '=3D>' proposed. Or any= other idea to differentiate it. '=3D>' would allow to combine match and capture like this: $o is Class{prop: int =3D> $y} C=C3=B4me