Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial values to traceable PDO array_reduce() (#523)
If the PDOTraceableDataCollector is enabled and no database calls happen to be made in a request, PHP 8.1 emits a fatal error, e.g., ``` <b>Fatal error</b>: Uncaught TypeError: DebugBar\DataCollector\PDO\TraceablePDO::getAccumulatedStatementsDuration(): Return value must be of type float, null returned in vendor/maximebf/debugbar/src/DebugBar/DataCollector/PDO/TraceablePDO.php:251 ``` The same error occurs in getMemoryUsage() and getPeakMemoryUsage(). Adding an initial value of 0 to `array_reduce()` corrects the problem. Corrects bug #522.
- Loading branch information