php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78389 ldap_control_paged_result deprecated - A bug or feature?
Submitted: 2019-08-09 04:45 UTC Modified: 2020-01-28 08:11 UTC
From: call dot user dot func at gmail dot com Assigned: mcmic (profile)
Status: Not a bug Package: LDAP related
PHP Version: 7.4.0beta2 OS: Windows 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: call dot user dot func at gmail dot com
New email:
PHP Version: OS:

 

 [2019-08-09 04:45 UTC] call dot user dot func at gmail dot com
Description:
------------
Starting with PHP 7.4 the function "ldap_control_paged_result" and "ldap_control_paged_result_response" is deprecated.
I have read the deprecations RFC from 7.4 and even 7.3 and i cannot find that should be deprecated.

https://wiki.php.net/rfc/deprecations_php_7_4
https://wiki.php.net/rfc/deprecations_php_7_3

If this is intended, please provide us with some information how we should work without that 2 functions to archive the same result.

Thank you.

Test script:
---------------
<?php
// make sure you have extension=ldap enabled in php.ini
ldap_control_paged_result(null, 0);
ldap_control_paged_result_response(null, null);

Expected result:
----------------
Funtions should not be deprecated

Actual result:
--------------
They are deprecated

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-09 04:53 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: mcmic
 [2019-08-09 04:53 UTC] requinix@php.net
This is intentional, and will be covered by the 7.4 changelog and migration guide.
https://github.com/php/php-src/commit/d93ce1795979e31255717fd770a2f0e901c06081

I'm no LDAP expert but according to the commit message, those functions "have serious limitations and may confuse users". Pagination is apparently covered by ldap_search() and its $serverctrls parameter.
https://www.php.net/manual/en/function.ldap-search.php
https://www.php.net/manual/en/ldap.controls.php
 [2019-08-13 07:26 UTC] mcmic@php.net
The comment above is correct.

You can look at example 5 on this page to have an example of the new syntax: https://www.php.net/manual/en/ldap.examples-controls.php

ldap_control_paged_result was setting controls for all future searches with no way of going back to no paging.
 [2019-08-13 15:26 UTC] call dot user dot func at gmail dot com
Thanks. Ive already integrated this behaviour with ldap_search and the new controls. Can be closed.
 [2020-01-24 10:58 UTC] mbiebl at messageconcept dot com
Hello,

given that those functions are now deprecated, I'd like to see documentation what one should use instead. I checked the documentation of ldap_search but couldn't figure out how to retrieve paged results.

Would it be possible to extend the ldap_search documentation and/or https://wiki.php.net/rfc/deprecations_php_7_4 ?
 [2020-01-28 08:11 UTC] mcmic@php.net
The RFC you linked is not related to this deprecation.

As posted before, please read the example 5 to see an example of paginated search using controls: https://www.php.net/manual/en/ldap.examples-controls.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC