Book Image

PhpStorm Cookbook

By : Mukund Chaudhary
Book Image

PhpStorm Cookbook

By: Mukund Chaudhary

Overview of this book

Table of Contents (16 chapters)
PhpStorm Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting a breakpoint


A breakpoint in a code is that point (or line of code) where you want the program execution to pause for a while. When you were cooking pizza and adding ingredients, suppose you wanted to know at any instant which ingredient was about to be added, you can set a breakpoint to actually make the interpreter pause at the line where the variable contained the name of the ingredient to be added. After a breakpoint is set, you can see which value a variable assumes under the variables frame in the debug window.

There are two types of breakpoints, which are as follows:

  • Permanent breakpoint: A normal breakpoint is one which remains till eternity, until you manually remove it

  • Temporary breakpoint: A temporary breakpoint, on the other hand, is a breakpoint that gets removed or disabled upon certain conditions, the most common being a hit.

How to do it...

  1. To set a normal breakpoint, you need to select a suspicious line of code by placing the cursor under it.

  2. Go to Run | Toggle Line...