original_string: protected function readLineFromFile($file)
      {
          $line = '';
          $position = ftell($file);
  
          if (0 === $position) {
              return;
          }
  
          while (true) {
              $chunkSize = min($position, 1024);
              $position -= $chunkSize;
              fseek($file, $position);
  
              if (0 === $chunkSize) {
                  // bof reached
                  break;
              }
  
              $buffer = fread($file, $chunkSize);
  
              if (false === ($upTo = strrpos($buffer, "\n"))) {
                  $line = $buffer.$line;
                  continue;
              }
  
              $position += $upTo;
              $line = substr($buffer, $upTo + 1).$line;
              fseek($file, max(0, $position), SEEK_SET);
  
              if ('' !== $line) {
                  break;
              }
          }
  
          return '' === $line ? null : $line;
      }
code: protected function readLineFromFile($file)
      {
          $line = '';
          $position = ftell($file);
  
          if (0 === $position) {
              return;
          }
  
          while (true) {
              $chunkSize = min($position, 1024);
              $position -= $chunkSize;
              fseek($file, $position);
  
              if (0 === $chunkSize) {
                  // bof reached
                  break;
              }
  
              $buffer = fread($file, $chunkSize);
  
              if (false === ($upTo = strrpos($buffer, "\n"))) {
                  $line = $buffer.$line;
                  continue;
              }
  
              $position += $upTo;
              $line = substr($buffer, $upTo + 1).$line;
              fseek($file, max(0, $position), SEEK_SET);
  
              if ('' !== $line) {
                  break;
              }
          }
  
          return '' === $line ? null : $line;
      }
code_tokens: protected function readLineFromFile ( $ file ) { $ line = '' ; $ position = ftell ( $ file ) ; if ( 0 === $ position ) { return ; } while ( true ) { $ chunkSize = min ( $ position , 1024 ) ; $ position -= $ chunkSize ; fseek ( $ file , $ position ) ; if ( 0 === $ chunkSize ) { // bof reached break ; } $ buffer = fread ( $ file , $ chunkSize ) ; if ( false === ( $ upTo = strrpos ( $ buffer , "\n" ) ) ) { $ line = $ buffer . $ line ; continue ; } $ position += $ upTo ; $ line = substr ( $ buffer , $ upTo + 1 ) . $ line ; fseek ( $ file , max ( 0 , $ position ) , SEEK_SET ) ; if ( '' !== $ line ) { break ; } } return '' === $ line ? null : $ line ; }
docstring: Reads a line in the file, backward.
  
  This function automatically skips the empty lines and do not include the line return in result value.
  
  @param resource $file The file resource, with the pointer placed at the end of the line to read
  
  @return mixed A string representing the line or null if beginning of file is reached
docstring_tokens: Reads a line in the file backward .