[php-src] Issue #22511: PHP 8.5 changed the order of keys in the return of ldap_explode_dn
| From: | come-nc | Date: | Mon, 29 Jun 2026 13:53:29 +0000 |
| Subject: | [php-src] Issue #22511: PHP 8.5 changed the order of keys in the return of ldap_explode_dn | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252305@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/22511
Author: come-nc
Hello, commit https://github.com/php/php-src/commit/30bc98ce0a726221b6f6242e82ae2a43548612b1
changed the behavior of ldap_explode_dn, with the count key not being the first key anymore but the
last one.
This breaking Nextcloud that was relying on this order (see https://github.com/nextcloud/server/issues/61446
)
This is also not matching the documentation at https://www.php.net/manual/en/function.ldap-explode-dn.php#refsect1-function.ldap-explode-dn-returnvalues
Was there a reason to change the key order? I see the tests were changed to test the new order so it
does not look like an oversight. It was not documented in https://www.php.net/manual/en/migration85.incompatible.php#migration85.incompatible.ldap
either.
We can (and probably will) change the code in Nextcloud to not rely on the order but I was quite
surprised by this subtle and unannounced break.
_Originally posted by @come-nc in https://github.com/php/php-src/issues/16092#issuecomment-4833339294_