Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89066 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14968 invoked from network); 4 Nov 2015 04:14:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2015 04:14:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=come@opensides.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain opensides.be designates 195.154.20.141 as permitted sender) X-PHP-List-Original-Sender: come@opensides.be X-Host-Fingerprint: 195.154.20.141 smtp.opensides.be Received: from [195.154.20.141] ([195.154.20.141:50881] helo=smtp.opensides.be) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/3C-13519-E1689365 for ; Tue, 03 Nov 2015 23:14:23 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id 1F5566E94E for ; Wed, 4 Nov 2015 05:14:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X6UVh0fLEEzE for ; Wed, 4 Nov 2015 05:14:19 +0100 (CET) Received: from mcmic-probook.localnet (node-11j8.pool-182-52.dynamic.totbb.net [182.52.190.4]) by smtp.opensides.be (Postfix) with ESMTPSA id 46CC96E918 for ; Wed, 4 Nov 2015 05:14:18 +0100 (CET) To: internals@lists.php.net Date: Wed, 04 Nov 2015 05:13:35 +0100 Message-ID: <2680231.U9fny6VzaI@mcmic-probook> Organization: OpenSides User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <3187501.to7rK1FKUl@mcmic-probook> References: <3187501.to7rK1FKUl@mcmic-probook> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: One last ldap_connect headache From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) I got mail from someone saying that in previous version, calling ldap_c= onnect($host, NULL) would use default port. While now it is considered as trying to use port 0 and trigger an error= . I=E2=80=99m a bit troubled about it because the documentation says: resource ldap_connect ([ string $hostname =3D NULL [, int $port =3D 38= 9 ]] ) So $port defaults to 389 and not to NULL, and it says nothing about acc= epting NULL as second parameter. That said, it does seem handful to be able to pass NULL to ask for defa= ult port without remembering which one it is. The context is something like: $port =3D NULL; if (isset($options['port'])) { =09$port =3D $options['port']; } $resource =3D ldap_connect($host, $port); Right now it either needs an if statement or hardcoding 389 instead of = NULL as the default. In the C code we use the constant LDAP_PORT for th= is but there is no such thing in PHP. Any ideas/comments about this? MCMic