Why this matters
Echo contaminates HTTP responses/CLI output and breaks APIs; logging is routable and level-aware.
Do not use echo/var_dump for diagnostics in application code; use a PSR-3 logger or error_log with levels.
Echo contaminates HTTP responses/CLI output and breaks APIs; logging is routable and level-aware.
Side-by-side examples engineers can pattern-match during review.
echo "DEBUG: ".$value; var_dump($payload);$logger->debug('payload received', ['size'=>strlen($raw)]);echo 'here';$logger->info('step done')From the same buckets as this rule.
Never emit Primary Account Number (PAN) or Sensitive Authentication Data (SAD: CVV/CVC, full track data, PIN) to application or audit logs. Per PCI DSS 4.0 Req. 3 and 10, always mask PAN as first6last4 and fully redact SAD before logging.