original_string: public static function endsWith($value, string $search, string $encoding = 'UTF-8'): bool
      {
          if (!static::isStringCastable($value)) {
              return false;
          }
  
          $searchlen = (int) mb_strlen($search, $encoding);
          $length = (int) mb_strlen((string) $value, $encoding);
          $end = mb_substr((string) $value, $length - $searchlen, $searchlen, $encoding);
  
          return $search === $end;
      }
code: public static function endsWith($value, string $search, string $encoding = 'UTF-8'): bool
      {
          if (!static::isStringCastable($value)) {
              return false;
          }
  
          $searchlen = (int) mb_strlen($search, $encoding);
          $length = (int) mb_strlen((string) $value, $encoding);
          $end = mb_substr((string) $value, $length - $searchlen, $searchlen, $encoding);
  
          return $search === $end;
      }
code_tokens: public static function endsWith ( $ value , string $ search , string $ encoding = 'UTF-8' ) : bool { if ( ! static :: isStringCastable ( $ value ) ) { return false ; } $ searchlen = ( int ) mb_strlen ( $ search , $ encoding ) ; $ length = ( int ) mb_strlen ( ( string ) $ value , $ encoding ) ; $ end = mb_substr ( ( string ) $ value , $ length - $ searchlen , $ searchlen , $ encoding ) ; return $ search === $ end ; }
docstring: Checks if value ends with a search string
  
  @param mixed  $value    The value
  @param string $search   The search string
  @param string $encoding The string encoding
  
  @return bool
docstring_tokens: Checks if value ends with a search string