Re: [RFC] LDAP EXOP

From: Date: Mon, 03 Jul 2017 15:04:02 +0000
Subject: Re: [RFC] LDAP EXOP
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-99704@lists.php.net to get a copy of this message
Hello, please change the signature form bool ldap_exop_whoami(resource $link, string &$result) to string ldap_whoami(resource $link); i dont see the benefit to return a single value with a reference. Without a reference the function can used as an argument: doSomethingWithTheUserName(ldap_whoami($link)); With a reference a variable is required: ldap_whoami($link, $username); doSomethingWithTheUserName($username); same with the return statement of a method: class MyLdap {
    public function getCurrentUser(): string
    {
        return ldap_whoami($this->link);
    }
} class MyLdap {
    function getCurrentUser(): string
    {
        ldap_whoami($this->link, $username);
        return $username;
    }
}

« previous php.internals (#99704) next »