Skip to content

Fix the type reported by the ldap_modify_batch() type errors - #25373

Merged
kocsismate merged 3 commits into
php:PHP-8.5from
lacatoire:fix/ldap-modify-batch-type-error-value-8.5
Nov 21, 2026
Merged

kocsismate merged 3 commits into
php:PHP-8.5from
lacatoire:fix/ldap-modify-batch-type-error-value-8.5

Conversation

@lacatoire

@lacatoire lacatoire commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Two type errors of ldap_modify_batch() (the "modtype" option must be of type int, the "values" option must be of type array) reported the type of attrib, a string already checked at that point, instead of the type of the rejected value. They now report the type of the value.

ldap_modify_batch_programming_error.phpt expected the wrong type for its stdClass modtype, so its expected output is updated.

To reproduce

ldap_modify_batch(ldap_connect('ldap://127.0.0.1:1'), "cn=x", [["attrib" => "a", "modtype" => [], "values" => ["v"]]]);

Before: ... must be of type int, string given

After: ... must be of type int, array given

Co-authored-by: Máté Kocsis <kocsismate90@gmail.com>
@kocsismate
kocsismate merged commit 3c1b49d into php:PHP-8.5 Nov 21, 2026
18 checks passed
kocsismate added a commit that referenced this pull request Nov 21, 2026
* PHP-8.6:
  ext/ldap: Fix the type reported by the ldap_modify_batch() type errors (#25373)
kocsismate added a commit to kocsismate/php-src that referenced this pull request Nov 21, 2026
* PHP-8.5:
  ext/ldap: Fix the type reported by the ldap_modify_batch() type errors (php#25373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants