php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

PHP 7.1 | "A non well formed numeric value encountered"

Open voku opened this issue 7 years ago • 3 comments

in "composer/maximebf/debugbar/src/DebugBar/DataCollector/TimeDataCollector.php"

     * Returns the duration of a request
     *
     * @return float
     */
    public function getRequestDuration()
    {
        if ($this->requestEndTime !== null) {
            return $this->requestEndTime - $this->requestStartTime;
        }
        return microtime(true) - $this->requestStartTime;
        ...

object(DebugBar\DataCollector\TimeDataCollector)#1675 (5) { ["requestStartTime":protected]=> string(15) "1493739115,4072" ["requestEndTime":protected]=> float(1493739115,6443) ["startedMeasures":protected]=> array(0) { } ["measures":protected]=> array(0) { } ["dataFormater":protected]=> NULL }

--> fix

return (float)$this->requestEndTime - (float)$this->requestStartTime;

https://bugs.php.net/bug.php?id=73468 (Status: Not a bug)

voku avatar May 02 '17 15:05 voku

Can you submit a PR?

barryvdh avatar May 03 '17 07:05 barryvdh

@barryvdh This issue could be closed.

caugner avatar Mar 19 '18 17:03 caugner

@barryvdh Would you mind closing this issue (which has been fixed by #329)?

caugner avatar Apr 29 '20 16:04 caugner