object LDAP([string binddn], [string bindpw], [string hostname])
To create the LDAP object, you should use the LDAP() function. If you specify a binddn, bindpw, and hostname, the parameters you supply will be used instead of the defaults (specified in the ldap.inc file). On creation, it will connect to the LDAP server.

If you don't create the object with the call to LDAP(), it will _NOT_ connect to the LDAP server until it a connection is neccessary.


$ldap = new LDAP(); 


$ldap = new LDAP;

$ldap = new LDAP("cn=root, o=mycompany.com", "secret", "ldap.mycompany.com");