protected function attach($stream)
    {
        if (is_resource($stream) === false) {
            throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource');
        }

        if (is_resource($this->stream) === true) {
            $this->detach();
        }

        $this->stream = $stream;
    }
protected function attach($stream)
    {
        if (is_resource($stream) === false) {
            throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource');
        }

        if (is_resource($this->stream) === true) {
            $this->detach();
        }

        $this->stream = $stream;
    }
protected function attach ( $ stream ) { if ( is_resource ( $ stream ) === false ) { throw new InvalidArgumentException ( __METHOD__ . ' argument must be a valid PHP resource' ) ; } if ( is_resource ( $ this -> stream ) === true ) { $ this -> detach ( ) ; } $ this -> stream = $ stream ; }
Attach new resource to this object
Attach new resource to this object