php-debugbar
php-debugbar copied to clipboard
PHP 8.0: TraceablePDO causes Fatal error
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
Hi, I also have this problem. We need update to PHP 8
https://github.com/maximebf/php-debugbar/pull/460 got merged but this is not auto-closed.
@barryvdh can you tag a new release including #460?
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.
Isn't this fixed in v1.6.4?
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.
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
Awesome! Thanks. Not updated on Packagist yet, but I'll check tonight. Now to get my Slack library to update to 8.0.
Packagist has been updated. I upgraded and all good now. I think we can close this issue. Thanks again for the new tag.
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
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.