Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126281 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 6E02E1A00BC for ; Tue, 4 Feb 2025 09:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1738661496; bh=aO/a8rG8pCTVmafEpXpL67RscRjvY3rV4yjZDCNXRhE=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=FDh8/UXxeKucvMhTTh1ZAHMZWjDgxMeLdo1SJ93n7DAoFfWncvZ0eHP4fr9l/c82p C6Nsec9xBRCAesE460KBncQ2nbVolJO1i8HPhfW10qqTXGVXkHpGAPzYEqTBq9ECTS PpZ+qv229H5tcgSnlQpypx7h/b4UsLfpRMX1TUYhlJ/OIXcskGFUSCCYsxVPvWqFNu DC4YNmWjTaa5BL7IN0+uoJCaDcabRopkiPdJjTLP7m47YU4UCGPl1QcVaRjLM66sYe waQlkmlo8t538zwb6KgzVqIGdLiFi1CCzkL8fadWCtXtY1UIJMt989gEbrVyptw6yj uKVhsCFEMM1FA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 30711180069 for ; Tue, 4 Feb 2025 09:31:35 +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.0 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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, 4 Feb 2025 09:31:34 +0000 (UTC) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-38634c35129so4191885f8f.3 for ; Tue, 04 Feb 2025 01:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738661660; x=1739266460; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=ZC3MK/0Zpo1zm6vqRAIDix9FcDeoHJgBsu7f7lZ5Zfc=; b=KWoeJtnkRLknFmnxPsV9MCExOaL1Xo72qSLs5W/Pcw7myCkRuKz5c80iAoBoRWHZcr xK9GZzZ+22DagUOrz+rg72DZTAWW0q1VF4Z/hkFzJo6vOAAxa8uLBPxYGh2e5wx+RfKE yByK/dcm78A0X3KQV92f7WsX89FuPGyOhqMflTqBwXoIY4jueRsagT6qCPrU14fQdilq qgi1XJ/GHj0SfNFZiAihZIxsXV6eU5g3bqd3GSGbYv+VsIWEvU/PfMUUVhtO00NUNgFy ViQLX+uZGVMhJ7c9W+DlWjy//iedV5PxfDTuGLijbzP5R5XZ406iBoEsJBLqKLCXEuVw nH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738661660; x=1739266460; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZC3MK/0Zpo1zm6vqRAIDix9FcDeoHJgBsu7f7lZ5Zfc=; b=aNvK/XuYpRmVdZ+OFxZG1cyN+9y8G48w/0imCcFOMUP8BaOfNk1otd7daXoXU3sdts fLryjgxK43ui4TI8cKXZrWNeA4wNk+hjype4NsQyGxMSdIieIMwm1wRR24UxRbEJ1LXk hxx4PLvFdwSj9JXgas0iYFdWTv3m1XO43qYJSN7YjgfZTBLldWZMtY7A5QeoDQE+ke9n 0x3eaW8My2d8NIFUZLJokfUkz873cUqM5seNcjmQAvGrEuDQpVM4WQpSf+5POqK0cOMV 4hzvsvkP4rJAINgmiTTv8oCJfPiInPJRSJQUb2titSO61Cy8KEa68erx1PbZMqENTyZM GkuQ== X-Forwarded-Encrypted: i=1; AJvYcCU9IsFagTX3zmA5fLmyMxtZsQVVT3w5FuedX7f5InA7r54KIXx8DU6QWi2GoDWnlzOG2zUk/zzNtw4=@lists.php.net X-Gm-Message-State: AOJu0YyjgFFY1+nIZhF9QnUsK0V8TsajNJ60IVoigBdnw14PMp/E6Xsi PirIH6ii4OEyXgiRI2bRVx+KpXNqzVONzSt/TsjI3HXbP27SbHy+ X-Gm-Gg: ASbGncvOpHupgKHZklbbkdhTbKXdkQ3o04c7mzC3XzHOof2PnjYih1vLe2CiJvS/auI Hpmek8O6Te+c9eIY0CbzZoZqcm/KVGPcLpeKNmBdzMTxVk39D0eeBIu5G3LAWiPYLm0lNZDjLmE zj6mchsJShriAJc82iY3trJ6PgCAq1lsK7qPTALC17ZnB1dG93pronI4rHQVHtO+o+muolmmo1q qx6kP0KIbc8BaTidRh0HLgTwhfDNCu+YhR/drwU9H6qkHPrw4fKfjGnj72uTiUmMoXllTP4MjQf W7m2smRtEkPOj8rwEMNqfdWHhub8OiB+9crxm9RgGAAlx/RCLUC9CHQxSg== X-Google-Smtp-Source: AGHT+IFa9wYFDNSxtIc3Ppevq9VIVkCjbCB4f2SSLFqbP16h1Mnowm+lJ0uvLK+z7zo0IKpWi9MGTA== X-Received: by 2002:a5d:588e:0:b0:385:f16d:48b4 with SMTP id ffacd0b85a97d-38c5209715fmr22802898f8f.40.1738661659032; Tue, 04 Feb 2025 01:34:19 -0800 (PST) Received: from smtpclient.apple (3611301-ch16866.twc1.net. [92.38.240.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38daf999747sm533653f8f.19.2025.02.04.01.34.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2025 01:34:18 -0800 (PST) X-Google-Original-From: Dmitry Derepko Message-ID: <296A94B1-3107-4DEB-8366-006BD73E63E2@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_1AE91402-4BAC-419F-BA0E-CEDC144348E3" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.113.1.2\)) Subject: Re: [PHP-DEV] Empty subject in match and switch constructions Date: Tue, 4 Feb 2025 12:34:06 +0300 In-Reply-To: Cc: Larry Garfield , php internals To: Claude Pache References: <2A357F88-BAF4-41DE-8646-6BBBF4EFF6F6@gmail.com> <99F2F71B-8BBA-449B-9FB4-54B1B608BB0A@gmail.com> X-Mailer: Apple Mail (2.3826.400.113.1.2) From: xepozzd@gmail.com (Dmitry Derepko) --Apple-Mail=_1AE91402-4BAC-419F-BA0E-CEDC144348E3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, Claude! > On Feb 4, 2025, at 11:44=E2=80=AFAM, Claude Pache = wrote: >=20 > Hi, >=20 > One issue to resolve is how to interpret: >=20 > ```php > $x =3D match { > preg_match('/a/', 'a') =3D> "will it be matched ..." > , default =3D> "... or not?" > }; > ``` >=20 > =E2=80=94Claude I wouldn=E2=80=99t discuss it there because the proposal is only about = short syntax. So making =E2=80=9Cmatch=E2=80=9D work in different way is not a goal = for the change. It must work as full form =E2=80=9Cmatch(true)=E2=80=9D: strict match, = which is "=3D=3D=3D=E2=80=9C. If you=E2=80=99re going to use non-strict comparison check =E2=80=9Cswitch= =E2=80=9D operator: https://3v4l.org/tHkJu Anyway, as for me it should be another thread. Thanks! ---------- Best regards, Dmitrii Derepko. @xepozz --Apple-Mail=_1AE91402-4BAC-419F-BA0E-CEDC144348E3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi, = Claude!

On Feb 4, 2025, at 11:44=E2=80=AFA= M, Claude Pache <claude.pache@gmail.com> wrote:

Hi,

One issue to = resolve is how to interpret:

```php
$x =3D match {
    preg_match('/a/', 'a') =3D> = "will it be matched ..."
 , default =3D> "... or not?"
};
```

=E2=80=94Claude

I = wouldn=E2=80=99t discuss it there because the proposal is only about = short syntax.
So making =E2=80=9Cmatch=E2=80=9D work in = different way is not a goal for the change.

It = must work as full form =E2=80=9Cmatch(true)=E2=80=9D: strict match, = which is "=3D=3D=3D=E2=80=9C.
If you=E2=80=99re going to use = non-strict comparison check =E2=80=9Cswitch=E2=80=9D operator: https://3v4l.org/tHkJu
Anywa= y, as for me it should be another thread. = Thanks!

----------

Best regards,
Dmitrii = Derepko.
@xepozz

= --Apple-Mail=_1AE91402-4BAC-419F-BA0E-CEDC144348E3--