PhpStorm 2023.3 Help

Code Inspection: Suspicious back reference

Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation.

Example of a group defined after its back reference:

\1(abc)

Example of a group and a back reference in different branches:

a(b)c|(xy)\1z

New in 2022.1

Suppress an inspection in the editor

  1. Place the caret at the highlighted line and press Alt+Enter or click the Intention action icon.

  2. Click the arrow next to the inspection you want to suppress and select the necessary suppress action.

Last modified: 25 March 2024