The thing is very simple:
$results = ldap_search( $ldapconn, 'DC=testdomain,DC=com', '(&(objectClass=user)(objectClass=computer))' );
This works, getting 3 results.
However, negating the second expression as defined in many manuals and tutorials, returns in Bad Search Filter:
$results = ldap_search( $ldapconn, 'DC=testdomain,DC=com', '(&(objectClass=user)(!objectClass=computer))' );
Any help?
[Wed Apr 10 16:59:05 2013] [error] [client 127.0.0.1] PHP Warning: ldap_search(): Search: Bad search filter in /var/www/test2.php on line 29