public function invert()
    {

        $this->containsNull = !$this->containsNull;

        if( $this->intervals === array( array(null, null) ) ) {
            $this->intervals = array();
            return $this;
        }

        $output = array();
        $working = array( null, null );

        reset( $this->intervals );

        while( list(,$interval) = each($this->intervals) ) {

            if( $interval[0] === null ) {

                $working[0] = $this->nextHighestValue( $interval[1] );

            } elseif( $interval[1] === null ) {

                $working[1] = $this->nextLowestValue( $interval[0] );
                break;

            } else {

                $working[1] = $this->nextLowestValue( $interval[0] );
                $output[] = $working;

                $working = array(
                    $this->nextHighestValue( $interval[1] ),
                    null
                );

            }

        }

        $output[] = $working;
        $this->intervals = $output;
        return $this;

    }
public function invert()
    {

        $this->containsNull = !$this->containsNull;

        if( $this->intervals === array( array(null, null) ) ) {
            $this->intervals = array();
            return $this;
        }

        $output = array();
        $working = array( null, null );

        reset( $this->intervals );

        while( list(,$interval) = each($this->intervals) ) {

            if( $interval[0] === null ) {

                $working[0] = $this->nextHighestValue( $interval[1] );

            } elseif( $interval[1] === null ) {

                $working[1] = $this->nextLowestValue( $interval[0] );
                break;

            } else {

                $working[1] = $this->nextLowestValue( $interval[0] );
                $output[] = $working;

                $working = array(
                    $this->nextHighestValue( $interval[1] ),
                    null
                );

            }

        }

        $output[] = $working;
        $this->intervals = $output;
        return $this;

    }
public function invert ( ) { $ this -> containsNull = ! $ this -> containsNull ; if ( $ this -> intervals === array ( array ( null , null ) ) ) { $ this -> intervals = array ( ) ; return $ this ; } $ output = array ( ) ; $ working = array ( null , null ) ; reset ( $ this -> intervals ) ; while ( list ( , $ interval ) = each ( $ this -> intervals ) ) { if ( $ interval [ 0 ] === null ) { $ working [ 0 ] = $ this -> nextHighestValue ( $ interval [ 1 ] ) ; } elseif ( $ interval [ 1 ] === null ) { $ working [ 1 ] = $ this -> nextLowestValue ( $ interval [ 0 ] ) ; break ; } else { $ working [ 1 ] = $ this -> nextLowestValue ( $ interval [ 0 ] ) ; $ output [ ] = $ working ; $ working = array ( $ this -> nextHighestValue ( $ interval [ 1 ] ) , null ) ; } } $ output [ ] = $ working ; $ this -> intervals = $ output ; return $ this ; }
Invert a set.
@return $this;
Invert a set .