Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123734 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 BCB181A009C for ; Fri, 21 Jun 2024 15:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718985499; bh=P2P++RTpOaY+P22ilgRkjxpDxLxeMv8RlmznYrm5yN4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ORMfpM75jx5fkvKyseVVogJ61C8CY6dOsCRkhu/0icl65f9emg4GeSrwWuqjTCCpi Wy5w4xiBfiQuMtuTAV4AeZGCO5LGaZAfb97S6t3gbB436xOeunQDLkrGo4X5YkRIGT 4yhm6sgUmHmwauMQ7IFr26Kcsi7C5pXt34Wv84UcbjE1KPky5bgXIN63qBmajvlpr3 qSKEme3kZAyBdQzYJO0d8Gm1MyVvr+SqQmLNVFah7vv4nxHsMdyMasNM12KTz11zKu TwztcG6jO6ovwYM/xozK0VwXlNzm7tVHNkRg+jnZB7gyTWbkdcTFUkPVgAQr5xNS5t xrGKhvUg1V+Ow== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4C82418064A for ; Fri, 21 Jun 2024 15:58:18 +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.3 required=5.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,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 wp160.webpack.hosteurope.de (wp160.webpack.hosteurope.de [80.237.132.167]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 21 Jun 2024 15:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mabe.berlin ; s=he194859; h=Content-Type:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:From:Sender:Reply-To:Subject:Date:Message-ID:To: Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=Vpm4rHTC3m8XbYbmUMQQ4dKkYuTF0+l4tLWycv5rglM=; t=1718985423; x=1719417423; b=dEecla1NESdWu9cIvCNSiOFrtqZ4l+QYUTKPybULb8DpsCruRf5K5fEqvWbHa7z5U/NMyR5byK x8JTbEzbWD4A8xUiGDlJhwfI6USaFJu3evef3iz1TtiIW8CmiQ4KgTxkmsOI/nCwKyCNGKAfW2y8S pcGvp2apze0EKPOrR2nUdVzS7I6/ngqoBt5imYE7zmSii8ae0+fcWdivqmt23s3aCWen01SWFduSd kr1236NTeedAgZGYh7rQv6fylT2u0wM+ZDsBeslK7746KUN5FTPjt//24PaoAjL99r9HQvDOKIOTt 3YPrsWtG/BS4kKJV+gtRyvaeCyZcdbrb3dZiQ==; Received: from [2a02:8109:b323:1700:81f5:37d2:a17c:833d]; authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1sKgdJ-0000gJ-9Z; Fri, 21 Jun 2024 17:57:01 +0200 Message-ID: <7ec12de5-b2f7-481c-acca-1b38f5be7deb@mabe.berlin> Date: Fri, 21 Jun 2024 17:57:00 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching To: internals@lists.php.net References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> Content-Language: en-US Autocrypt: addr=marc@mabe.berlin; keydata= xsBNBFby8roBCAD4qHjbk9+V3SmB5DfpkTtX58jYJ9VXVfF54MDoI0fQiYvKyrrghfO78alH c12RsEZxLH2F5kEfu8WO4wA4apg2gBnRRxqPj7krsct1ySOAdMrRVp8Wtaeaznpdcn2gJZyA MSI6LTzebT25N77ksvSrUi1BuCKyOa7SmYff3xGgOwYsHQlT5opMNGPCVegiPmO/K37anwts gj6L7RVtjXtp2Z3wAs6r3EmO318PL48xDLUgYMvEFAPJglth5FGH2En6n6HFIhxh43LqXQiN eHVjLjS2y8huNBswwc9ZVxk3ip5z/GCmpWnNkgGBOSJ7loJRsq2tOaU6yU8KWb5rhOoFABEB AAHNIU1hcmMgQmVubmV3aXR6IDxtYXJjQG1hYmUuYmVybGluPsLAeAQTAQIAIgUCVvLyugIb AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQOTar91O8iM6jzggAwvV6MqU/hcAI6ldp xVjucGz2J9cAWtva8GL+rm9zvEs7EENtamehJiZob/CTw50WiI/zsJzPblktpT0D2AFBEp9k P5/8CmCpZzxYPsxnLtsFM52fOBpO+aP0PSStBpJjndjBH7HPqKcTCXM3ZM+SL6lyRweAJR7G +JXIZbuUrbjB2lbGx3itNZ6TeXqqnE6KTXNKLEbNHfVdzE4sPDkmuZRo/M2h+gmeS1iQb29W BmhvL6czugCQI9rYl7C4Nci9wPii1lTYyfCWQfQKID4/F2HiOv+N/vDMCK1xV8TUeCy8w4X+ nYj+wDog046ki9lUM60oPij6WoSJLqfsXr1kNc7ATQRW8vK6AQgAq7QYLB1Dz+8RSi5AGJP1 tOFQXtcxyOhNVQZsI1mCQiHay4wteQ+5m4EOUuR+FrFIlnbSrPdTkKD2wvQDHVqpZivThBpJ vara/ick0wi2R3dasu1sPMu1P6h1EwUsydhviNJB07aLfPAWD6eoqmGTd8236znIIq7mbnNp OnxIQxviTyELUekrNw38uQtVzR6XZv9PAThA2o1J1JZID7QUpKcNyo9ebYlwxyS+xzhA4DLD qfD6O5sKoKvxEf2fIZeP0ETPpHNYk0WiWnmNoPy8eEY07LriYALVidBwPBcxus0wGoKf8Nun y2aE13SHmj0ioBI1bXMGJx3hEbvzXK6WrwARAQABwsBfBBgBAgAJBQJW8vK6AhsMAAoJEDk2 q/dTvIjOkowIAI70P8U4j3eqyK/7x1bnCZZRcpwZ1aH+LR1yMKTINo9NDqlOBWQTLT69YMfV 4UN+nTSiD/uLw1fSeLSzBwpoalCMLPVOX/d3Mq5JtL5cKtWUTIVf3Vb7VbN4Rvb8HgWjeSnM 1PiG9yQBmLKI68sG/gdgvA/xANdUatkDgG0yj8PCdt+Vy4EblXbIAXZXJ6eRugSKowTjst7i HXKOJxivomHFcmqmkiqjwGTGx/jrhbDtEpPDRk+U9W45D4CbUcyPR6lMSrje5JPGQDv/45M5 wPe286YelBjnb0cWRJpA7GZCWDKZOsQ2H6cCRBi8i4m+vfRk7GLA536XnmvWxKFVP9U= In-Reply-To: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------rY09pUM4QyDCCFtGZGNj5NXM" X-bounce-key: webpack.hosteurope.de;marc@mabe.berlin;1718985423;027d4511; X-HE-SMSGID: 1sKgdJ-0000gJ-9Z From: marc@mabe.berlin (Marc Bennewitz) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------rY09pUM4QyDCCFtGZGNj5NXM Content-Type: multipart/mixed; boundary="------------inXuOjivA09Pk43CLwXRw8xd"; protected-headers="v1" From: Marc Bennewitz To: internals@lists.php.net Message-ID: <7ec12de5-b2f7-481c-acca-1b38f5be7deb@mabe.berlin> Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> In-Reply-To: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> --------------inXuOjivA09Pk43CLwXRw8xd Content-Type: multipart/mixed; boundary="------------GyiJ2WkF8U5wcH3328HnZHAR" --------------GyiJ2WkF8U5wcH3328HnZHAR Content-Type: multipart/alternative; boundary="------------EosEejXd4HVVjlG3s0wBvpVL" --------------EosEejXd4HVVjlG3s0wBvpVL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGkgTGFycnksDQoNCk9uIDIwLjA2LjI0IDE5OjM4LCBMYXJyeSBHYXJmaWVsZCB3cm90ZToN Cj4gSGVsbG8sIHBlb3BsZXMuDQo+DQo+IElsaWphIGFuZCBJIGhhdmUgYmVlbiB3b3JraW5n IG9uIGFuZCBvZmYgb24gYW4gUkZDIGZvciBwYXR0ZXJuIG1hdGNoaW5nIHNpbmNlIHRoZSBl YXJseSB3b3JrIG9uIEVudW1lcmF0aW9ucy4gIEEgbnVtYmVyIG9mIHBlb3BsZSBoYXZlIG5v dGljZWQgYW5kIHNhaWQgdGhleSdyZSBsb29raW5nIGZvcndhcmQgdG8gaXQuDQo+DQo+IEl0 J3MgZGVmaW5pdGVseSBub3QgZ29pbmcgdG8gbWFrZSBpdCBpbnRvIDguNCwgYnV0IHdlIGFy ZSBsb29raW5nIGZvciBlYXJseSBmZWVkYmFjayBvbiBzY29waW5nIHRoZSBSRkMuICBJbiBz aG9ydCwgdGhlcmUncyBhIHdob2xlIGJ1bmNoIG9mIHBvc3NpYmxlIHBhdHRlcm5zIHRoYXQg Y291bGQgYmUgaW1wbGVtZW50ZWQsIGFuZCBzb21lIG9mIHRoZW0gd2UgYWxyZWFkeSBoYXZl LCBidXQgd2Ugd2FudCB0byBnZXQgYSBzZW5zZSBvZiB3aGF0IHNjb3BlIHRoZSB6ZWl0Z2Vp c3Qgd291bGQgd2FudCBpbiB0aGUgImluaXRpYWwiIFJGQywgd2hpY2ggd291bGQgYmUgYXBw cm9wcmlhdGUgYXMgc2Vjb25kYXJ5IHZvdGVzLCBhb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QgSSB3b3VsZCBleHBlY3QgbmF0aXZlIHJlZ2V4IA0Kc3ludGF4IGZpcnN0IGJl Zm9yZSBpbnRyb2R1Y2luZyBpdCBhcyBwYXJ0IG9mIGEgZGlmZmVyZW50IFJGQy4gU2ltaWxh ciANCmFzIGdlbmVyaWNzLg0KDQpGb2xsb3dpbmcgdXAgSSB3b3VsZCBleHBlY3Qgc29tZXRo aW5nIGxpa2UgdGhpczoNCg0KIMKgwqDCoCAkcmUgPSAvLiovO8KgIC8vIFJlZ0V4IG9iamVj dA0KIMKgwqDCoCAkbWF0Y2hlcyA9ICRyZS0+bWF0Y2goJHYpOyAvLyBwcmVnX21hdGNoDQog wqDCoMKgICR2IGlzICRyZTsgLy8gdXNlZCBpbiBwYXR0ZXJuIG1hdGNoaW5nDQoNCndoaWNo IG9wZW5zIHVwIGFub3RoZXIgcXVlc3Rpb246IENvdWxkIHdlIGhhdmUgYW4gaW50ZXJmYWNl IGFsbG93aW5nIA0Kb2JqZWN0cyB0byBtYXRjaCBpbiBhIHNwZWNpZmljIHdheT8NCg0KIMKg wqDCoCBpbnRlcmZhY2UgTWF0Y2hhYmxlIHsNCiDCoMKgwqDCoMKgwqDCoCBwdWJsaWMgZnVu Y3Rpb24gbWF0Y2gobWl4ZWQgJHZhbHVlKTogYm9vbDsNCiDCoMKgwqAgfQ0KDQpUaGFua3Mg Zm9yIHdvcmtpbmcgb24gaXQhDQoNCk1hcmMNCg0K --------------EosEejXd4HVVjlG3s0wBvpVL Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi Larry,

On 20.06.24 19:38, Larry Garfield wrote:
=
Hello, peoples.

Ilija and I have been working on and off on an RFC for pattern matching s=
ince the early work on Enumerations.  A number of people have noticed and=
 said they're looking forward to it.

It's definitely not going to make it into 8.4, but we are looking for ear=
ly feedback on scoping the RFC.  In short, there's a whole bunch of possi=
ble patterns that could be implemented, and some of them we already have,=
 but we want to get a sense of what scope the zeitgeist would want in the=
 "initial" RFC, which would be appropriate as secondary votes, and which =
we should explicitly save-for-later.  The goal is to not spend time on pa=
rticular patterns that will be contentious or not pass, and focus effort =
on fleshing out and polishing those that do have a decent consensus.  (An=
d thereby, we hope, avoiding an RFC failing because enough people dislike=
 one little part of it.)

To that end, we're looking for *very high level* feedback on this RFC:

https://wiki.php.net/rfc/pattern-matching

By "very high level," I mean, please, do not sweat specific syntax detail=
s right now.  That's a distraction.  What we're asking right now is "whic=
h of these patterns should we spend time sweating specific syntax details=
 on in the coming weeks/months?"  There will be ample time for detail bik=
eshedding later, and we've identified a couple of areas where we know for=
 certain further syntax development will be needed because we both hate t=
he current syntax. :-)

If you want to just read the Overview section for a survey of the possibl=
e patterns and our current recommendations, you likely don't need to read=
 the rest of the RFC at this point.  You can if you want, but again, plea=
se stay high-level.  Our goal at the moment is to get enough feedback to =
organize the different options into three groups:

1. Part of the RFC.
2. Secondary votes in the RFC.
3. Future Scope.

So we know where to focus our efforts to bring it to a proper discussion.=


Thank you all for your participation.

Is is already a really nice RFC, even if not finished yet. Also haven't fully read it yet.
Thank you for all your work and time put into it!

I do have some questions:

* For the generics-like pattern I do agree with the others that this might be dangerous for the future if we (hopefully) are going at it.

* Capturing values out of a pattern and binding them to variables if matched.

Where this is very helpful especially with `match`, from the syntax I would read it as a condition only.

=C2=A0=C2=A0=C2=A0 $p is Point {x: 3, y: $y}; // read as $p->y =3D=3D=3D $y but it's $y =3D $p->y

But this is described differently

=C2=A0 =C2=A0 $p is Point {y: 37, x:@($x)};

I think it would be more readable on switching the logic (somehow). like:

=C2=A0=C2=A0=C2=A0 $p is Point {x: 3, y: $y}; // $p->y =3D=3D=3D $y
=C2=A0=C2=A0=C2=A0
$p is Point = {x: 3, y:=3D> $y}; // $y =3D $p->y

* Regex pattern

This one is interesting as well ... but I would expect native regex syntax first before introducing it as part of a different RFC. Similar as generics.

Following up I would expect something like this:

=C2=A0=C2=A0=C2=A0 $re =3D /.*/;=C2=A0 // RegEx object
=C2=A0=C2=A0=C2=A0 $matches =3D $re->match($v); // preg_match =C2=A0=C2=A0=C2=A0 $v is $re; // used in pattern matching

which opens up another question: Could we have an interface allowing objects to match in a specific way?

=C2=A0=C2=A0=C2=A0 interface Matchable {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 public function match(mi= xed $value): bool;
=C2=A0=C2=A0=C2=A0 }

Thanks for working on it!

Marc

--------------EosEejXd4HVVjlG3s0wBvpVL-- --------------GyiJ2WkF8U5wcH3328HnZHAR Content-Type: application/pgp-keys; name="OpenPGP_0x3936ABF753BC88CE.asc" Content-Disposition: attachment; filename="OpenPGP_0x3936ABF753BC88CE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xsBNBFby8roBCAD4qHjbk9+V3SmB5DfpkTtX58jYJ9VXVfF54MDoI0fQiYvKyrrg hfO78alHc12RsEZxLH2F5kEfu8WO4wA4apg2gBnRRxqPj7krsct1ySOAdMrRVp8W taeaznpdcn2gJZyAMSI6LTzebT25N77ksvSrUi1BuCKyOa7SmYff3xGgOwYsHQlT 5opMNGPCVegiPmO/K37anwtsgj6L7RVtjXtp2Z3wAs6r3EmO318PL48xDLUgYMvE FAPJglth5FGH2En6n6HFIhxh43LqXQiNeHVjLjS2y8huNBswwc9ZVxk3ip5z/GCm pWnNkgGBOSJ7loJRsq2tOaU6yU8KWb5rhOoFABEBAAHNIU1hcmMgQmVubmV3aXR6 IDxtYXJjQG1hYmUuYmVybGluPsLAeAQTAQIAIgUCVvLyugIbAwYLCQgHAwIGFQgC CQoLBBYCAwECHgECF4AACgkQOTar91O8iM6jzggAwvV6MqU/hcAI6ldpxVjucGz2 J9cAWtva8GL+rm9zvEs7EENtamehJiZob/CTw50WiI/zsJzPblktpT0D2AFBEp9k P5/8CmCpZzxYPsxnLtsFM52fOBpO+aP0PSStBpJjndjBH7HPqKcTCXM3ZM+SL6ly RweAJR7G+JXIZbuUrbjB2lbGx3itNZ6TeXqqnE6KTXNKLEbNHfVdzE4sPDkmuZRo /M2h+gmeS1iQb29WBmhvL6czugCQI9rYl7C4Nci9wPii1lTYyfCWQfQKID4/F2Hi Ov+N/vDMCK1xV8TUeCy8w4X+nYj+wDog046ki9lUM60oPij6WoSJLqfsXr1kNc7A TQRW8vK6AQgAq7QYLB1Dz+8RSi5AGJP1tOFQXtcxyOhNVQZsI1mCQiHay4wteQ+5 m4EOUuR+FrFIlnbSrPdTkKD2wvQDHVqpZivThBpJvara/ick0wi2R3dasu1sPMu1 P6h1EwUsydhviNJB07aLfPAWD6eoqmGTd8236znIIq7mbnNpOnxIQxviTyELUekr Nw38uQtVzR6XZv9PAThA2o1J1JZID7QUpKcNyo9ebYlwxyS+xzhA4DLDqfD6O5sK oKvxEf2fIZeP0ETPpHNYk0WiWnmNoPy8eEY07LriYALVidBwPBcxus0wGoKf8Nun y2aE13SHmj0ioBI1bXMGJx3hEbvzXK6WrwARAQABwsBfBBgBAgAJBQJW8vK6AhsM AAoJEDk2q/dTvIjOkowIAI70P8U4j3eqyK/7x1bnCZZRcpwZ1aH+LR1yMKTINo9N DqlOBWQTLT69YMfV4UN+nTSiD/uLw1fSeLSzBwpoalCMLPVOX/d3Mq5JtL5cKtWU TIVf3Vb7VbN4Rvb8HgWjeSnM1PiG9yQBmLKI68sG/gdgvA/xANdUatkDgG0yj8PC dt+Vy4EblXbIAXZXJ6eRugSKowTjst7iHXKOJxivomHFcmqmkiqjwGTGx/jrhbDt EpPDRk+U9W45D4CbUcyPR6lMSrje5JPGQDv/45M5wPe286YelBjnb0cWRJpA7GZC WDKZOsQ2H6cCRBi8i4m+vfRk7GLA536XnmvWxKFVP9U=3D =3Doi2m -----END PGP PUBLIC KEY BLOCK----- --------------GyiJ2WkF8U5wcH3328HnZHAR-- --------------inXuOjivA09Pk43CLwXRw8xd-- --------------rY09pUM4QyDCCFtGZGNj5NXM Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEENJIbKB0SAX2RmUKbOTar91O8iM4FAmZ1oswFAwAAAAAACgkQOTar91O8iM6B /ggAwbRh0HIYRMhETjLXMtcgCVwOszw1GcjHnHaRk2egUVBYGnqPm/GSwIzn6mooijWjaxgoHUjv iuccVP0dwhK0bXcXa0YN6ueT4oMd4esTf2GIk58T5Sfm1Kk9dKDePSRhllPaHDIS4ucpYZ0Vjk7i Ch/Jo23PVDV++ySP9oOuw0BCsPsnXkWDFcALqvIZKG9RhqMXIwDDTi2Cl4ctkjRvkVO+dmy1Jstg doU2lP5ND+MDXgoQMMrmttxN47Pfl6RGPM/kYIP9wpIYR+gUzfNQqqSaRz0FMJFp6Ksm/C7tC/+e 2oCvpZ2dyHmInw1YCtPueuEObVLnjSeGG6rTHnXQHQ== =rOxB -----END PGP SIGNATURE----- --------------rY09pUM4QyDCCFtGZGNj5NXM--