function __construct($host_or_socket, $port = null, $password = null) { switch (func_num_args()) { case 1: $r = new_ESLconnection($host_or_socket); break; case 2: $r = new_ESLconnection($host_or_socket, $port); break; default: $r = new_ESLconnection($host_or_socket, $port, $password); } $this->_cPtr = $r; }
function __construct($host_or_socket, $port = null, $user_or_password = null, $password = null) { if (is_resource($host_or_socket) && get_resource_type($host_or_socket) === '_p_ESLconnection') { $this->_cPtr = $host_or_socket; return; } switch (func_num_args()) { case 1: $this->_cPtr = new_ESLconnection($host_or_socket); break; case 2: $this->_cPtr = new_ESLconnection($host_or_socket, $port); break; case 3: $this->_cPtr = new_ESLconnection($host_or_socket, $port, $user_or_password); break; default: $this->_cPtr = new_ESLconnection($host_or_socket, $port, $user_or_password, $password); } }