mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

delaying the object creation only before ldap initialisation. fix forgotten url freeing on TLS error code path. close GH-18645
24 lines
499 B
PHP
24 lines
499 B
PHP
--TEST--
|
|
ldap_connect() - Connection errors
|
|
--EXTENSIONS--
|
|
ldap
|
|
--INI--
|
|
error_reporting=E_ALL & ~E_DEPRECATED
|
|
--FILE--
|
|
<?php
|
|
require "connect.inc";
|
|
try {
|
|
ldap_connect("nope://$host", 65536);
|
|
} catch (\ValueError $e) {
|
|
echo $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
try {
|
|
ldap_connect("nope://$host", 0);
|
|
} catch (\ValueError $e) {
|
|
echo $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
ldap_connect(): Argument #2 ($port) must be between 1 and 65535
|
|
ldap_connect(): Argument #2 ($port) must be between 1 and 65535
|