Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99704 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36290 invoked from network); 3 Jul 2017 15:04:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2017 15:04:09 -0000 X-Host-Fingerprint: 62.180.109.77 unknown Received: from [62.180.109.77] ([62.180.109.77:13739] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/81-15131-6EC5A595 for ; Mon, 03 Jul 2017 11:04:06 -0400 Message-ID: To: internals@lists.php.net References: <2963553.WttLOBJENj@mcmic-probook> Date: Mon, 3 Jul 2017 17:04:02 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2963553.WttLOBJENj@mcmic-probook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 62.180.109.77 Subject: Re: [RFC] LDAP EXOP From: gmblar@gmail.com (Andreas Treichel) 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; } }