How to debug PHP effectively

Step-by-step: reproduce, hypothesize, log, patch minimally.

Resources and examples