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

PHP 8.0: TraceablePDO causes Fatal error

Open caugner opened this issue 4 years ago • 11 comments
trafficstars

Whoops\Exception\ErrorException thrown with message "Declaration of DebugBar\DataCollector\PDO\TraceablePDO::query($statement) must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs)"

Stacktrace:
#2 Whoops\Exception\ErrorException in C:\***\vendor\maximebf\debugbar\src\DebugBar\DataCollector\PDO\TraceablePDO.php:146
#1 Whoops\Run:handleError in C:\***\vendor\filp\whoops\src\Whoops\Run.php:408
#0 Whoops\Run:handleShutdown in [internal]:0

caugner avatar Nov 30 '20 13:11 caugner

Hi, I also have this problem. We need update to PHP 8

ynssenem avatar Dec 07 '20 03:12 ynssenem

https://github.com/maximebf/php-debugbar/pull/460 got merged but this is not auto-closed.

glensc avatar Dec 10 '20 08:12 glensc

@barryvdh can you tag a new release including #460?

IonBazan avatar Jan 12 '21 04:01 IonBazan

Any progress on PHP 8.0 support? I commented out Debug Bar for now, as it is completely broken in PHP 8.0. Sounds like a version tag issue. Any reason not to release label a v1.16.5 release? Seems like the last commit is pretty trivial and will fix the issue.

phpfui avatar Jan 19 '21 01:01 phpfui

Isn't this fixed in v1.6.4?

barryvdh avatar Jan 19 '21 03:01 barryvdh

From composer.lock:

        "name": "maximebf/debugbar",
        "version": "v1.16.4",

PHP 8.0.0:

Fatal error: Declaration of DebugBar\DataCollector\PDO\TraceablePDO::query($statement) must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs)

Looks like the most recent commit will fix this.

phpfui avatar Jan 19 '21 03:01 phpfui

I've tagged a new release, unfortunately it can take up to 24 hours to detect this tag, as the hook is not configured correctly and I can't change that. You can use composer require maximebf/debugbar:1.16.x@dev for now

barryvdh avatar Jan 19 '21 06:01 barryvdh

Awesome! Thanks. Not updated on Packagist yet, but I'll check tonight. Now to get my Slack library to update to 8.0.

phpfui avatar Jan 19 '21 15:01 phpfui

Packagist has been updated. I upgraded and all good now. I think we can close this issue. Thanks again for the new tag.

phpfui avatar Jan 20 '21 00:01 phpfui

This still isn't included in the latest release?

No annotations or return type hint present in 1.17.3?

https://github.com/maximebf/php-debugbar/blob/v1.17.3/src/DebugBar/DataCollector/PDO/TraceablePDO.php#L32

fisharebest avatar Jan 26 '22 20:01 fisharebest

There are still several outstanding PHP 8.1 issues. I put in PR https://github.com/maximebf/php-debugbar/pull/497 that should fix most of them. Since these are all trivial non logic type fixes, they should be no-brainers to merge and release. Right now, DebugBar does not work on PHP 8.1 really.

phpfui avatar Jan 26 '22 20:01 phpfui