note 128256 added to control-structures.match
| From: | thomas at zuschneid dot de | Date: | Mon, 27 Feb 2023 15:04:09 +0000 |
| Subject: | note 128256 added to control-structures.match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220214@lists.php.net to get a copy of this message | ||
While match allows chaining multiple conditions with ",", like:
<?php
$result = match ($source) {
cond1, cond2 => val1,
default => val2
};
?>
it seems not valid to chain conditions with default, like:
<?php
$result = match ($source) {
cond1 => val1,
cond2, default => val2
};
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 130.133.174.242)
----
Manual Page -- https://php.net/manual/en/control-structures.match.php
Edit -- https://main.php.net/note/edit/128256
Del: integrated -- https://main.php.net/note/delete/128256/integrated
Del: useless -- https://main.php.net/note/delete/128256/useless
Del: bad code -- https://main.php.net/note/delete/128256/bad+code
Del: spam -- https://main.php.net/note/delete/128256/spam
Del: non-english -- https://main.php.net/note/delete/128256/non-english
Del: in docs -- https://main.php.net/note/delete/128256/in+docs
Del: other reasons-- https://main.php.net/note/delete/128256
Reject -- https://main.php.net/note/reject/128256
Search -- https://main.php.net/manage/user-notes.php