note 129315 added to control-structures.match
| From: | tolga.ulas@tolgaulas.com | Date: | Tue, 05 Mar 2024 21:48:59 +0000 |
| Subject: | note 129315 added to control-structures.match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221236@lists.php.net to get a copy of this message | ||
Yes it currently does not support code blocks but this hack works:
match ($foo){
'bar'=>(function(){
echo "bar";
})(),
default => (function(){
echo "baz";
})()
};
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 176.240.16.103)
----
Manual Page -- https://php.net/manual/en/control-structures.match.php
Edit -- https://main.php.net/note/edit/129315
Del: integrated -- https://main.php.net/note/delete/129315/integrated
Del: useless -- https://main.php.net/note/delete/129315/useless
Del: bad code -- https://main.php.net/note/delete/129315/bad+code
Del: spam -- https://main.php.net/note/delete/129315/spam
Del: non-english -- https://main.php.net/note/delete/129315/non-english
Del: in docs -- https://main.php.net/note/delete/129315/in+docs
Del: other reasons-- https://main.php.net/note/delete/129315
Reject -- https://main.php.net/note/reject/129315
Search -- https://main.php.net/manage/user-notes.php