match expression must be terminated by a semicolon

Paul McGarry <[email protected]>
Newsgroups gmane.comp.php.general
Message-ID <CAPrE0SZKrRfgkj6emOH9yXqSGRB5uso9Er_a9d3DAijae2o1iQ@mail.gmail.com>
Hi all,

Does anyone have any insight into what

Note: A match expression must be terminated by a semicolon ;.


means on:
https://www.php.net/manual/en/control-structures.match.php

Match doesn't seem to need it's own semicolon, ie the following works just
fine:

php > $foo='bar';

php > echo urlencode(match($foo) {'boo'=>'hoo','bar'=>'bing'});

bing

php > $foo='boo';

php > echo urlencode(match($foo) {'boo'=>'hoo','bar'=>'bing'});

hoo
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.