Inspectopedia Help

'match' can be replaced with 'switch' statement

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 ( and switch ( for details.

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3



Last modified: 13 July 2023