PHPCompatibility / PHPCompatibility/PHPCompatibility

PHP 8.3: deprecate dba_fetch()

Open
#1,978 7 comments 0 reactions 1 assignee View on GitHub

@afilina is already working on this.

Since Oct 31, 2025.

PHP: 8.3 Status: to be implemented Type: enhancement
Dominant language
PHP
Stars
2.3k
Forks
201
Avg merge
3d 18h
Merged PRs (30d)
42

Description

Related to #1589

Analysis

Recap of existing PHP 8.2 behavior based on the RFC:

// Signature 1: called with 2 or 3 arguments.
function dba_fetch(string|array $key, resource $dba, int $skip = 0): string|false {}

// Signature 2: called with exactly 3 arguments, and $dba trades places with $skip
function dba_fetch(string|array $key, int $skip, resource $dba): string|false {}

Updated behavior for each version:

// Signature 1: unchanged
function dba_fetch(string|array $key, resource $dba, int $skip = 0): string|false {}

// Signature 2: deprecated in PHP 8.3
function dba_fetch(string|array $key, int $skip, resource $dba): string|false {}
Detection in PHP 8.2
  • dba_fetch(...) with 3rd argument of type int, see "Syntax Variations" below.
Detection in PHP 8.3
  • dba_fetch(...) with 2nd argument of type int, see "Syntax Variations" below.
Top 2000 Packages

Found 2 usages of dba_fetch in the top 2000 packages. Neither uses the deprecated signature.

Examples in james-heinrich/getid3:

dba_fetch(getID3::VERSION, $this->dba) != getID3::VERSION
$result = dba_fetch($key, $this->dba);
Syntax Variations
  • dba_fetch(..., 1, ...) ✅ Can be handled by PHPCompatibility.
  • dba_fetch(..., $skip, ...) ❌ Unreliable, as $skip could be defined anywhere.
3v4l.org

dba_fetch() is not available on 3v4l.org

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.