What are the differences between using YAML, XML, and PHP for configuration in Symfony, and how can they be effectively utilized for LDAP integration?

When configuring LDAP integration in Symfony, you can use YAML, XML, or PHP for configuration. YAML is a human-readable format that is easy to write and understand. XML is more verbose but can be useful for complex configurations. PHP allows for dynamic configurations and can be useful for more advanced customization. Example PHP code snippet for LDAP integration in Symfony using YAML configuration:

// config/packages/ldap.yaml

parameters:
    ldap_host: 'ldap.example.com'
    ldap_port: 389
    ldap_base_dn: 'dc=example,dc=com'
    ldap_username: 'cn=admin,dc=example,dc=com'
    ldap_password: 'password'

services:
    ldap:
        class: Symfony\Component\Ldap\Ldap
        arguments:
            - 'ldap://%ldap_host%:%ldap_port%'
            - null
            - null
            - { bindRequiresDn: true, accountDomainName: 'example.com', accountDomainNameShort: 'example' }