PhpStorm 8.0.0 Web Help

PhpStorm enables you to evaluate arbitrary single-line expressions and provides a way to quickly evaluate an expression in the editor at caret or a selection.

On this page:

Warning

While using the Expression Evaluation feature, be aware of the following:

  • A method can be invoked within the Expression Evaluation dialog only if the debugger has stopped at a breakpoint, but has not been paused.
  • Expression Evaluation can be only "single-level". In other words, if PhpStorm stops at a breakpoint within a method called from the Expression Evaluation, you cannot use the Expression Evaluation feature again.
Evaluating an arbitrary expression
  1. Open the Evaluate Expression dialog box. Do one of the following:
    • Choose Run | Evaluate Expression on the main menu.
    • PressAlt+F8Shift+Alt+8Shift+Alt+8Alt+F8Alt+F8Alt+F8Ctrl+F9Ctrl+UAlt F8Alt F8Command U.
    • To have a specific variable evaluated, select it on the Variables pane, then choose Run | Evaluate Expression or pressAlt+F8Shift+Alt+8Shift+Alt+8Alt+F8Alt+F8Alt+F8Ctrl+F9Ctrl+UAlt F8Alt F8Command U.
  2. In the Evaluate Expression dialog box, specify the expression to evaluate in the Expression field. Type the expression in question or choose one of the previously evaluated expressions from the drop-down list.

    Note

    If you have selected a specific variable on the Variables pane, this variable will be displayed in the Expression text box.

  3. Click the Evaluate button. The Result read-only field shows the evaluation output. If the specified expression cannot be evaluated, the Result field explains the reason.

Tip

During the debugger session, the value of any expression at caret is shown at the tooltip every time you hover your mouse pointer over it. If an expression contains children, clicking add expands the node and displays all children.

However, Quick evaluate expression helps you view the expression value using the keyboard only.

To quickly evaluate an expression in the editor

There are two ways to quickly evaluate an expression:

  • 8.1+ By using the Show Value On Selection Change functionality:
    1. In the Debug tool window toolbar click the Settings icon projectToolWindowSettingsIcon and select the Show Value On Selection Change option from the popup menu.
    2. Select a code fragment with the mouse, or by clicking Ctrl+W. A tooltip with the expression value automatically appears under the selection and changes each time you change the selection:

      evaluate_selection

  • By manually invoking the tooltip with the expression value:
    1. Place the caret at the desired location, or select an expression to be evaluated.
    2. Press Ctrl+Alt+F8Ctrl+Alt+8 or Ctrl+Shift+Alt+Button1 ClickCtrl+Alt+8 or Ctrl+Shift+Alt+Button1 ClickCtrl+Alt+8 or Ctrl+Shift+Alt+Button1 ClickCtrl+Alt+F8Shift+F9Ctrl+Alt+F8Ctrl+Alt+F8Alt Command F8Alt Command F8Alt Command F8. The tooltip with the expression value appears under the selected expression.

      py_quickEvaluateExpression

See Also

Procedures:

Reference:

Web Resources: