public function __construct($out = STDOUT) { if (is_resource($out) === false || get_resource_type($out) !== 'stream') { throw new \InvalidArgumentException('Given filepointer is not a resource of type stream'); } $this->out = $out; }