It doesn't make much sense to let die() the script in case of an error, otherwise to ask if there were no errors before proceeding the script, as the official examples do.
better:
<?php
ldap_bind(...) or die(...);
do_something();
?>
or even better (die() is quick but dirty)
<?php
if (!ldap_bind(...)) {
error();
} else {
do_something();
}
?>