XML_RPC_Response::__construct PHP Method

__construct() public method

Constructor
public __construct ( mixed $val, integer $code, string $fstr = '' ) : void
$val mixed
$code integer
$fstr string
return void
    public function __construct($val, $code = 0, $fstr = '')
    {
        if ($code !== 0) {
            // error
            $this->errno = $code;
            $this->errstr = htmlspecialchars($fstr, is_php('5.4') ? ENT_XML1 | ENT_NOQUOTES : ENT_NOQUOTES, 'UTF-8');
        } elseif (!is_object($val)) {
            // programmer error, not an object
            error_log("Invalid type '" . gettype($val) . "' (value: " . $val . ') passed to XML_RPC_Response. Defaulting to empty value.');
            $this->val = new XML_RPC_Values();
        } else {
            $this->val = $val;
        }
    }