php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78522 ldap_error returns null | string | bool
Submitted: 2019-09-10 06:51 UTC Modified: 2019-09-10 06:57 UTC
From: imbolk at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 7.3.9 OS: MacOS/Linux
Private report: No CVE-ID: None
 [2019-09-10 06:51 UTC] imbolk at gmail dot com
Description:
------------
https://www.php.net/ldap_error :

ldap_error ( resource $link_identifier ) : string

Test script:
---------------
 php -r '@var_dump(ldap_error(fopen("/etc/passwd", "r")));'

 php -r '@var_dump(ldap_error(1));'

Expected result:
----------------
string(0) ""
string(0) ""

Actual result:
--------------
false
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-10 06:57 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2019-09-10 06:57 UTC] requinix@php.net
https://www.php.net/manual/en/functions.internal.php
> Note: If the parameters given to a function are not what it expects, such as passing an array where a string is
> expected, the return value of the function is undefined. In this case it will likely return NULL but this is just
> a convention, and cannot be relied upon.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC