Inspectopedia
 
2024.3

'match' can be replaced with 'switch' statement

Info
New
Last modified: 03 December 2024

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.