PHP error : traceablePDO
DebugBar\DataCollector\PDO\TraceablePDO::getAccumulatedStatementsDuration(): Return value must be of type float, null returned
File : maximebf/debugbar/src/DebugBar/DataCollector/PDO/TraceablePDO.php:251
line 251 : return array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getDuration(); });
PATCH File : maximebf/debugbar/src/DebugBar/DataCollector/PDO/TraceablePDO.php:251
` /** * Returns the accumulated execution time of statements * * @return float */ public function getAccumulatedStatementsDuration() : float { return (float)array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getDuration(); }); }
/**
* Returns the peak memory usage while performing statements
*
* @return int
*/
public function getMemoryUsage() : int
{
return (int)array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getMemoryUsage(); });
}
/**
* Returns the peak memory usage while performing statements
*
* @return int
*/
public function getPeakMemoryUsage() : int
{
return (int)array_reduce($this->executedStatements, function ($v, $s) { $m = $s->getEndMemory(); return $m > $v ? $m : $v; });
}`
PHP 8.1.16
Also get "Use of "parent" in callables is deprecated" due to the use in bindColumn and bindParam on PHP 7.4.
Fix: Replace 'parent' with 'PDOStatement'
Close by https://github.com/maximebf/php-debugbar/pull/523
Already fixed