public function throwsAnythingExcept()
    {
        try {
            $this->data[0]();
        } catch (Exception $exception) {
            $exceptionClass = get_class($exception);
            if ($exceptionClass === $this->data[1]) {
                throw new DidNotMatchException(
                    "Expected any exception except {$this->data[1]} to be " .
                    "thrown, but $exceptionClass was thrown."
                );
            }
        }
    }
public function throwsAnythingExcept()
    {
        try {
            $this->data[0]();
        } catch (Exception $exception) {
            $exceptionClass = get_class($exception);
            if ($exceptionClass === $this->data[1]) {
                throw new DidNotMatchException(
                    "Expected any exception except {$this->data[1]} to be " .
                    "thrown, but $exceptionClass was thrown."
                );
            }
        }
    }
public function throwsAnythingExcept ( ) { try { $ this -> data [ 0 ] ( ) ; } catch ( Exception $ exception ) { $ exceptionClass = get_class ( $ exception ) ; if ( $ exceptionClass === $ this -> data [ 1 ] ) { throw new DidNotMatchException ( "Expected any exception except {$this->data[1]} to be " . "thrown, but $exceptionClass was thrown." ) ; } } }
Assert any exception except a specific one was thrown.

@syntax closure ?:callable throws anything except ?:class
@throws DidNotMatchException
Assert any exception except a specific one was thrown .