dgoosens,
@dgoosens@phpc.social avatar

Remember you can make @Xdebug breakpoints conditional in

saves a lot of time...
and avoids leaving dirty if statements in your code

dgoosens,
@dgoosens@phpc.social avatar

and there is more !!
click on "More"

and you will be able to:

  • add additional logging info
  • add statements that you want to evaluate when hitting the breakpoint
  • only trigger the breakpoint if another breakpoint was hit
  • make sure the breakpoint is only triggered once

@Xdebug rocks !

#php #PHPStorm

image/png

dgoosens, (edited )
@dgoosens@phpc.social avatar

one of my personal favorites
is an automatic breakpoint whenever an exception is thrown

this is easy as pie with @Xdebug

Simply add a "PHP Exception Breakpoint" that will suspend as soon as an Exception is hit

Once more, one can add conditions, for instance, the Exception's type or subtype
(@derickr just pointed out to me it does an instance_of check)

#brilliant !
#php #phpstorm

Xdebug,
@Xdebug@phpc.social avatar

@dgoosens It does an instance_of check, so you don't need the exact name either. For example, you can do DateException (PHP 8.3) and it will pause on its children too.

michael, (edited )
@michael@thms.uk avatar

@dgoosens oh, I did not know about that yet. That’s pretty cool!

bobmagicii,
@bobmagicii@phpc.social avatar

@dgoosens not having to explain what the var dumps with the db credentials are, is enough to make sure i clean up my old school debugging 🤣

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines