# ext/ldap for PHP6

- Thread: https://externals.io/message/44085
- Original archive: https://news-web.php.net/php.internals/44085
- Started by Patrick ALLAERT on 2009-05-28T16:05:38+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #44085 — Patrick ALLAERT — 2009-05-28T16:05:38+00:00

URL: https://externals.io/message/44085#44085

Hi list,

Having done some PHPT tests on ext/ldap [1] with Davide Mendolia at
the Testfest, we realized that the extension wasn't ready in PHP 6.
In attachment I put a patch that enables all LDAP tests [1] to "PASS"
using PHP6.

As it is my first patch here, could you please revise it and give me
your comments?

The following changes have been made:
- Comparing to IS_UNICODE in addition to IS_STRING.
- Using zend_utf8_hash_find() instead of zend_hash_find.
- Being sick of duplicating "efree(ldap_base_dn)" everywhere there is
an exit, the handling of error is refactored using a "goto cleanup" in
combination with storing the return value in "ret".
- Parallel/Non-parallel search lightly refactored for clarity.
- Dropping WRONG_PARAM_COUNT while zend_parse_parameters() does a good
job (not present anymore in 5.3).

Thanks,

Patrick

[1] http://testfest.php.net/repos/testfest/BelgiumUG/ext/ldap/tests/
