PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: 'match' can be replaced with 'switch' statement

Last modified: 16 May 2022

Reports the match expressions that can be replaced with switch statements.

Note that match expressions use strict type comparison, while switch statements rely on loose comparison. As a result, the expression semantics may change after replacement.

See match (php.net) and switch (php.net) for details.