Xdebug instruments every function call, so it sees everything and multiplies the runtime by three to five. A sampling profiler interrupts periodically and records the stack, so it distorts almost nothing and misses anything short.
; xdebug — development, exact call counts, unusable in production
xdebug.profiler_enable_trigger=1
; sampling — production, statistically accurate, low overhead
The consequence is that the two disagree, and both are right. A function called fifty thousand times for a microsecond each dominates an Xdebug profile because the instrumentation cost is per call, and barely registers in a sample. When a local profile says one thing and production says another, this is usually why. Profile in production for where the time goes; profile locally for why a specific function is slow.