Commit d189a3f5b68 for php

commit d189a3f5b682eb530d81dac45f22c1f508baf6dd
Merge: c8ca69e6852 fac5881398c
Author: Tim Düsterhus <tim@tideways-gmbh.com>
Date:   Tue Nov 17 09:41:07 2026 +0100

    Merge branch 'PHP-8.4' into PHP-8.5

    * PHP-8.4:
      ldap: Fix the ldap_set_option() controls type error naming the wrong option (#25502)

diff --cc ext/ldap/ldap.c
index edeab9ed1ae,ca9e5fc2202..ee9fa763ad4
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@@ -3342,9 -3362,12 +3342,11 @@@ PHP_FUNCTION(ldap_set_option
  	case LDAP_OPT_CLIENT_CONTROLS:
  		{
  			LDAPControl **ctrls;
 -			int rc;

  			if (Z_TYPE_P(newval) != IS_ARRAY) {
- 				zend_argument_type_error(3, "must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, %s given", zend_zval_value_name(newval));
+ 				zend_argument_type_error(3, "must be of type array for the %s option, %s given",
+ 					option == LDAP_OPT_SERVER_CONTROLS ? "LDAP_OPT_SERVER_CONTROLS" : "LDAP_OPT_CLIENT_CONTROLS",
+ 					zend_zval_value_name(newval));
  				RETURN_THROWS();
  			}

diff --cc ext/ldap/tests/ldap_set_option_error.phpt
index eda3dc51217,f784524fce2..a7e71261d4b
--- a/ext/ldap/tests/ldap_set_option_error.phpt
+++ b/ext/ldap/tests/ldap_set_option_error.phpt
@@@ -38,4 -39,5 +38,4 @@@ foreach ($controls as $control)
  bool(false)
  ValueError: ldap_set_option(): Control must have an "oid" key
  TypeError: ldap_set_option(): Argument #3 ($value) must contain only arrays, where each array is a control
- TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, string given
+ TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_SERVER_CONTROLS option, string given
 -bool(false)