Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PHP
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Addition of the match expression ==== {{Main|PHP syntax and semantics#Match expression}} PHP 8 introduced the {{code|match}} expression.<ref name="Redmond-2020">{{cite web |last1=Redmond |first1=Paul |title=Match Expression is Coming to PHP 8 |url=https://laravel-news.com/match-expression-php-8 |website=Laravel News |date=15 July 2020 |access-date=4 October 2020}}</ref> The match expression is conceptually similar to a {{code|switch}} statement and is more compact for some use cases.<ref name="PHP Watch">{{cite web |title=PHP 8.0: Match Expressions |url=https://php.watch/versions/8.0/match-expression |website=PHP Watch |access-date=4 October 2020}}</ref> Because {{code|match}} is an expression, its result can be assigned to a variable or returned from a function.<ref>{{cite web |last1=Barnes |first1=Eric |title=PHP 8 is now Released! |url=https://laravel-news.com/php-8 |website=Laravel News |date=27 November 2020 |access-date=24 December 2020 |ref=laravel-news-php-8-released}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)