Skip to content

Conversation

@kassner
Copy link

@kassner kassner commented Nov 28, 2025

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

dba_* functions had their signature changed in PHP 8.4 to return 
a \Dba\Connection instance.
@ondrejmirtes
Copy link
Member

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

@kassner
Copy link
Author

kassner commented Nov 28, 2025

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

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

@ondrejmirtes
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants