phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

PHP 8.4 ext-dba function signatures

Open kassner opened this issue 3 months ago • 4 comments

dba_* functions had their signature changed in PHP 8.4 to return a \Dba\Connection instance.

kassner avatar Nov 28 '25 13:11 kassner

Please share phpstan.org/try with an error first.

ondrejmirtes avatar Nov 28 '25 13:11 ondrejmirtes

https://phpstan.org/r/6ad959ee-2851-4447-bb1c-90a511f93445

Parameter #2 $handle of function dba_fetch expects resource, Dba\Connection|false given.

kassner avatar Nov 28 '25 13:11 kassner

@kassner I think the right solution is to put dba_fetch\'1 key into old section in resources/functionMap_php83delta.php.

  1. This signature is deprecated in PHP 8.3.
  2. The problem is that PHPStan is thrown off by the extra variant. You could look for the root cause and fix it (the fact that information from phpstan/php-8-stubs is not used there), but the easy fix is to put dba_fetch\'1 key into old section in resources/functionMap_php83delta.php.

The problem here is that phpstan/php-8-stubs info is not applied to dba_fetch.

ondrejmirtes avatar Nov 29 '25 15:11 ondrejmirtes

This pull request has been marked as ready for review.

phpstan-bot avatar Dec 11 '25 17:12 phpstan-bot