diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index fdca8351124..3fea267d14f 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2101,7 +2101,6 @@ PHP_FUNCTION(ldap_explode_dn) { zend_long with_attrib; char *dn, **ldap_value; - int i, count; size_t dn_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &dn, &dn_len, &with_attrib) != SUCCESS) { @@ -2113,16 +2112,12 @@ PHP_FUNCTION(ldap_explode_dn) RETURN_FALSE; } - i=0; - while (ldap_value[i] != NULL) i++; - count = i; - array_init(return_value); - - add_assoc_long(return_value, "count", count); - for (i = 0; i --EXPECT-- array(4) { - ["count"]=> - int(3) [0]=> string(6) "cn=bob" [1]=> string(10) "dc=example" [2]=> string(6) "dc=com" + ["count"]=> + int(3) } array(5) { - ["count"]=> - int(4) [0]=> string(6) "cn=bob" [1]=> @@ -54,20 +52,20 @@ array(5) { string(10) "dc=example" [3]=> string(6) "dc=com" + ["count"]=> + int(4) } array(4) { - ["count"]=> - int(3) [0]=> string(3) "bob" [1]=> string(7) "example" [2]=> string(3) "com" + ["count"]=> + int(3) } array(5) { - ["count"]=> - int(4) [0]=> string(3) "bob" [1]=> @@ -76,6 +74,8 @@ array(5) { string(7) "example" [3]=> string(3) "com" + ["count"]=> + int(4) } bool(false) bool(false)