What could be the reason for having this:
public function __construct($host, $port, $timeout = 5){
$errnum = 0;
$errstr = '';
Instead of this:
public function __construct($host, $port, $errnum = 0, $errstr = '', $timeout = 5){
?
Why some are params and others aren’t ?
Thanks a lot,
MEM
A function definition defines a contract between the function itself and the code that calls it.
A variable should only be a parameter if the caller should specify it’s value. Otherwise if a variable is only used internally by the function, there is no need to specify it as a parameter.