public function setState($state)
    {
        $state &= ~248; // 0b11111000

        if (($state & ($state - 1)) !== 0) {
            throw new InvalidArgumentException("State must be a valid state value");
        }

        $this->setFlags($state);
        $this->streamCallback = null;
    }
public function setState($state)
    {
        $state &= ~248; // 0b11111000

        if (($state & ($state - 1)) !== 0) {
            throw new InvalidArgumentException("State must be a valid state value");
        }

        $this->setFlags($state);
        $this->streamCallback = null;
    }
public function setState ( $ state ) { $ state &= ~ 248 ; // 0b11111000 if ( ( $ state & ( $ state - 1 ) ) !== 0 ) { throw new InvalidArgumentException ( "State must be a valid state value" ) ; } $ this -> setFlags ( $ state ) ; $ this -> streamCallback = null ; }
Switches the internal state to one of the supported states.

@param int $context State flag.
Switches the internal state to one of the supported states .