Debugging ElePHPants

A presentation at PHPSerbia 2017 in May 2017 in Belgrade, Serbia by Adam Culp

Slide 1

Slide 1

Debugging ElePHPants By: Adam Culp Twitter: @adamculp

Slide 2

Slide 2

Debugging ElePHPants About me ● – OSS Contributor – PHP Certified – Zend Certification Advisory Board – PHP-Fig voting member (IBM i Toolkit) – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organizer SunshinePHP (Miami) – Long distance (ultra) runner – Photography Enthusiast – 2 Judo Black Belt Instructor

Slide 3

Slide 3

Debugging ElePHPants About me ● – OSS Contributor – PHP Certified – Zend Certification Advisory Board – PHP-Fig voting member (IBM i Toolkit) – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organizer SunshinePHP (Miami) – Long distance (ultra) runner – – 3 I am the Photography Enthusiast PHP Ninja!!! Judo Black Belt Instructor

Slide 4

Slide 4

Debugging ElePHPants ● 4 I Help Build The Web

Slide 5

Slide 5

Debugging ElePHPants ● Manual Debugging Methods – 5 Manual ● Echo “” ● Print “” ● eval() ● print_r() ● var_dump() ● die() ● console_log() ● Toolbars (framework specific of otherwise)

Slide 6

Slide 6

Debugging ElePHPants ● The Ugly – 6

Slide 7

Slide 7

Debugging ElePHPants ● Automated – 7

Slide 8

Slide 8

Debugging ElePHPants ● Breakpoints – Inform debugger to stop execution at a given point – Click in the gutter to activate a breakpoint. – 8 A red dot is added, and line highlights in red

Slide 9

Slide 9

Debugging ElePHPants ● 9 IDE Listening – Activate “listening” in chosen IDE – Call up the app in a browser

Slide 10

Slide 10

Debugging ElePHPants ● IDE Debugging Starts – 10 Debug panel or perspective

Slide 11

Slide 11

Debugging ElePHPants ● Automated Debugging Methods – 11 Step-Debugging ● Step Over ● Step Into (and Force Step Into) ● Step Out

Slide 12

Slide 12

Debugging ElePHPants ● Automated Debugging Methods – Step-Over ● Decline to follow call into a class or function. ● 12 Button or F8 key

Slide 13

Slide 13

Debugging ElePHPants ● Automated Debugging Methods – Step-Into ● Accept to follow call into a class or function. ● 13 Button or F7 key

Slide 14

Slide 14

Debugging ElePHPants ● Automated Debugging Methods – Step-Out ● Break out of a class or function, back to execution point. ● 14 Button or ^F8 key (Shift+F8)

Slide 15

Slide 15

Debugging ElePHPants ● Thank you! ● Code at: https://github.com/adamculp Adam Culp http://www.rungeekradio.com http://www.geekyboy.com Twitter @adamculp