$ldapconn = ldap_connect($ldaphost)
or die("Could not connect to {$ldaphost}");
?>FALSE on error.
When OpenLDAP 2.x.x is used, ldap_connect() will always
return a resource as it does not actually connect but just
initializes the connecting parameters. The actual connect happens with
the next calls to ldap_* funcs, usually with
ldap_bind().If no arguments are specified then the link identifier of the already opened link will be returned."
Testei com um servidor openldap e, de fato, mesmo a conexao estando errada foi retornado um resource (podes verificar fazendo var_dump(ldap_connect(lararara)) ). Assim, eu diria que o correto é verificar o retorno da proxima função ldap que voce utilizar. Para suprimir erros utilize um @ antes do nome da função.
--
--
============================================================
JQUERY MAGAZINE > http://www.jquerymagazine.com.br
--
PHP MAGAZINE > http://www.phpmagazine.com.br
--
LISTA NODE.JS > https://groups.google.com/group/lista-nodejs?hl=pt-br
--
AJAX-BRASIL > http://groups.google.com/group/ajax-brasil
--
PYTHON-GOOGLE > http://groups.google.com.br/group/python-google
--
DOTNET-BRASIL > http://groups.google.com.br/group/dotnet_br
============================================================
---
Você está recebendo esta mensagem porque se inscreveu no grupo "LISTA PHP" dos Grupos do Google.
Para cancelar a inscrição neste grupo e parar de receber seus e-mails, envie um e-mail para listaphp+u...@googlegroups.com.
Para obter mais opções, acesse https://groups.google.com/groups/opt_out.