original_string: public static function getExtBySignature($stream)
      {
          $prefix = strval(bin2hex(mb_strcut($stream, 0, 10)));
  
          foreach (self::$signatures as $signature => $extension) {
              if (0 === strpos($prefix, strval($signature))) {
                  return $extension;
              }
          }
  
          return '';
      }
code: public static function getExtBySignature($stream)
      {
          $prefix = strval(bin2hex(mb_strcut($stream, 0, 10)));
  
          foreach (self::$signatures as $signature => $extension) {
              if (0 === strpos($prefix, strval($signature))) {
                  return $extension;
              }
          }
  
          return '';
      }
code_tokens: public static function getExtBySignature ( $ stream ) { $ prefix = strval ( bin2hex ( mb_strcut ( $ stream , 0 , 10 ) ) ) ; foreach ( self :: $ signatures as $ signature => $ extension ) { if ( 0 === strpos ( $ prefix , strval ( $ signature ) ) ) { return $ extension ; } } return '' ; }
docstring: Get file extension by file header signature.
  
  @param string $stream
  
  @return string
docstring_tokens: Get file extension by file header signature .