[DOC-CVS] [doc-en] master: Prefer comma over || for match conditions (#4564)

[email protected] (William Entriken via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: William Entriken (fulldecent)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2025-06-05T18:36:52+01:00

Commit: https://github.com/php/doc-en/commit/17502ebe0691a84e7d0738c13e8c1061dde98de7
Raw diff: https://github.com/php/doc-en/commit/17502ebe0691a84e7d0738c13e8c1061dde98de7.diff

Prefer comma over || for match conditions (#4564)

Changed paths:
  M  language/control-structures/match.xml


Diff:

diff --git a/language/control-structures/match.xml b/language/control-structures/match.xml
index 4ba34725ebfe..f74bf7064644 100644
--- a/language/control-structures/match.xml
+++ b/language/control-structures/match.xml
@@ -290,8 +290,8 @@ string(11) "young adult"
 $text = 'Bienvenue chez nous';
 
 $result = match (true) {
-    str_contains($text, 'Welcome') || str_contains($text, 'Hello') => 'en',
-    str_contains($text, 'Bienvenue') || str_contains($text, 'Bonjour') => 'fr',
+    str_contains($text, 'Welcome'), str_contains($text, 'Hello') => 'en',
+    str_contains($text, 'Bienvenue'), str_contains($text, 'Bonjour') => 'fr',
     // ...
 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.