PhpStorm 2019.1 Help

Setting Labels to Variables, Objects and Watches

You can add your own label to a variable, object, or watch and then reference it as if it were a local variable <label-name>_DebugLabel defined in the same context where the expression is evaluated. PhpStorm also displays these labels in suggestion lists for code completion in the Evaluate Expression dialog.

To assign a label

  1. Select the desired variable in the Debug window.

  2. Press F11 or select Mark Object from the context menu. The Select object label dialog opens.

  3. Specify the label name. Use alphanumeric characters without spaces. Optionally, click Browse the Browse button next to the preview to change the label color.

  4. Click OK to assign the label.

To remove a label

  1. Locate the variable that holds the marked object in the Debug window.

  2. Press F11 or right-click the variable and select Unmark Object from the context menu.

Last modified: 26 July 2019

See Also