1--TEST--
2ldap_connect() - Variation
3--CREDITS--
4Patrick Allaert <patrickallaert@php.net>
5# Belgian PHP Testfest 2009
6--SKIPIF--
7<?php require_once('skipif.inc'); ?>
8--FILE--
9<?php
10require "connect.inc";
11
12// no hostname, no port
13$link = ldap_connect();
14var_dump($link);
15
16// no port
17$link = ldap_connect($host);
18var_dump($link);
19
20// URI
21$link = ldap_connect("ldap://$host:$port");
22var_dump($link);
23
24// URI no port
25$link = ldap_connect("ldap://$host");
26var_dump($link);
27
28// bad hostname (connect should work, not bind)
29$link = ldap_connect("nonexistent" . $host);
30var_dump($link);
31
32// Legacy host:port syntax
33$link = ldap_connect("$host:$port");
34var_dump($link);
35?>
36===DONE===
37--EXPECTF--
38resource(%d) of type (ldap link)
39resource(%d) of type (ldap link)
40resource(%d) of type (ldap link)
41resource(%d) of type (ldap link)
42resource(%d) of type (ldap link)
43resource(%d) of type (ldap link)
44===DONE===
45