src/Matcher/ToThrow.php
public static function _sameMessage($actual, $expected)
    {
        if (preg_match('~^(?P<char>\~|/|@|#).*?(?P=char)$~', (string) $expected)) {
            $same = preg_match($expected, $actual);
        } else {
            $same = $actual === $expected;
        }
        return $same || !$expected;
    }
public static function _sameMessage($actual, $expected)
    {
        if (preg_match('~^(?P<char>\~|/|@|#).*?(?P=char)$~', (string) $expected)) {
            $same = preg_match($expected, $actual);
        } else {
            $same = $actual === $expected;
        }
        return $same || !$expected;
    }
public static function _sameMessage ( $ actual , $ expected ) { if ( preg_match ( '~^(?P<char>\~|/|@|#).*?(?P=char)$~' , ( string ) $ expected ) ) { $ same = preg_match ( $ expected , $ actual ) ; } else { $ same = $ actual === $ expected ; } return $ same || ! $ expected ; }
Compare if exception messages are similar.

@param  string  $actual   The actual message.
@param  string  $expected The expected message.
@return boolean
Compare if exception messages are similar .