Bug #79165 [NEW]: trying to access ldap_get_entries array triggers: Trying to access array offset
| From: | mbiebl at messageconcept dot com | Date: | Fri, 24 Jan 2020 11:55:25 +0000 |
| Subject: | Bug #79165 [NEW]: trying to access ldap_get_entries array triggers: Trying to access array offset | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225091@lists.php.net to get a copy of this message | ||
From: mbiebl at messageconcept dot com
Operating system:
PHP version: 7.4.2
Package: LDAP related
Bug Type: Bug
Bug description:trying to access ldap_get_entries array triggers: Trying to access array offset
Description:
------------
I have the following code
$result = ldap_search($con, $dn, $filter, $justthese);
$entries = ldap_get_entries($con, $result);
and then the following code to iterate through the results
foreach ($entries as $e) { ... }
This code worked fine with 7.3 and now yields the following error with
7.4:
"Trying to access array offset on value of type resource"
ldap_get_entries() is supposed to return an array and var_dump($entries)
prints
array(11) {
["count"]=>
int(10)
[0]=>
....
}
So something is at odds here. Why does PHP 7.4 think $entries is not an
array?
--
Edit bug report at https://bugs.php.net/bug.php?id=79165&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79165&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79165&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79165&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79165&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79165&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79165&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79165&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79165&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79165&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79165&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79165&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79165&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79165&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79165&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79165&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79165&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79165&r=mysqlcfg