Skip to content

dba_list() is now zero-indexed instead of using resource ids #16990

Closed

Description

@alexandre-daubois

Description

While adding new casters to Symfony, we came across a 8.4 regression. The following code:

<?php

$dba = dba_open('test.db', 'c');
var_dump(dba_list());

Resulted in this output:

array(1) {
  [0]=>
  string(52) "/Users/mac-ADAUBO01/PhpstormProjects/symfony/test.db"
}

But I expected this output instead:

array(1) {
  [52] =>
  string(52) "/Users/mac-ADAUBO01/PhpstormProjects/symfony/test.db"
}

Works fine on PHP 8.3.14. This makes it not possible to gather information with dba_list() by casting the resource/Dba\Connection to integer.

PHP Version

PHP 8.4.1

Operating System

macOS 15.1.1

Activity

  1. self-assigned this
    on Nov 29, 2024
  2. kocsismate commented on Nov 30, 2024

    @kocsismate
    Member

    Hi @alexandre-daubois,

    Thanks for the report! It was a small oversight, so I've just submitted the bugfix at #17005

  3. added a commit that references this issue on Dec 2, 2024
    50264b0
  4. added a commit that references this issue on Dec 2, 2024
    01093b7
  5. kocsismate commented on Dec 2, 2024

    @kocsismate
    Member

    The bug should be fixed whenever PHP 8.4.2 is released. :)

  6. alexandre-daubois commented on Dec 3, 2024

    @alexandre-daubois
    MemberAuthor

    Thank you very much!

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions