Slide 1

Slide 1 text

A minimalists intro to XDEBUG Claudio Mettler, CtrlM Singapore August 2015 1

Slide 2

Slide 2 text

xdebug... • ...provides new functions useful for debugging, logging and testing • ...changes the behaviour of some core PHP functionality • ...does profiling • ...implements a remote debugging protocol 2

Slide 3

Slide 3 text

A word of caution • do not run on live servers (for performance and security reasons) • may cause extreme twitchiness when watching people debug without a debugger 3

Slide 4

Slide 4 text

new functions • code coverage analysis • xdebug_call_class(), xdebug_call_file(), xdebug_call_function(), xdebug_get_headers() • etc. 4

Slide 5

Slide 5 text

Modified behaviour • includes a stack trace in error messages • var_dump can do colors now • function nesting limit of 100! • etc. 5

Slide 6

Slide 6 text

6

Slide 7

Slide 7 text

7

Slide 8

Slide 8 text

profiling • creates CacheGrind files • topic for another talk 8

Slide 9

Slide 9 text

remote debugging: Installation • pecl install xdebug • apt-get install php5-xdebug • edit config:
 
 xdebug.remote_connect_back=1
 xdebug.remote_enable=1
 9

Slide 10

Slide 10 text

remote debugging: IDE SETUP • accept incoming connections • path mapping 10

Slide 11

Slide 11 text

remote debugging • set breakpoints • enable listener • start session in browser 11

Slide 12

Slide 12 text

live demo 12

Slide 13

Slide 13 text

check out the competition • phpdbg: part of PHP now • zend debugger 13

Slide 14

Slide 14 text

A little bedtime story 14

Slide 15

Slide 15 text

15

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

17

Slide 18

Slide 18 text

https://speakerdeck.com/claudiomettler/intro-to-xd 18