<commit_before><?php
  require('lang.base.php');
  xp::sapi('cli');
  uses('lang.Process');
  
  $source= '';
  while (!feof(STDIN)) {
    $source.= fgets(STDIN);
  }

  // Fork PHP, feed script to it
  $p= &new Process('php -l');
  
  $in= &$p->getInputStream();
  $in->write($source);
  $in->close();
  
  $out= &$p->getOutputStream();
  
  while (!$out->eof()) {
    $l= $out->readLine();
    
    if (preg_match('#^(.*) in - on line (\d+)$#', $l, $match)) {
      Console::writeLine($match[2]);
      Console::writeLine($match[1]);
      exit;
    }
  }
?>
<commit_msg>- fix new Process signature<commit_after><?php
  require('lang.base.php');
  xp::sapi('cli');
  uses(
    'lang.Process',
    'lang.System'
  );
  
  $source= '';
  while (!feof(STDIN)) {
    $source.= fgets(STDIN);
  }

  $php_command= '';
  foreach (explode(PATH_SEPARATOR, System::getEnv('PATH')) as $path) {
    if (file_exists($path.DIRECTORY_SEPARATOR.'php')) {
      $php_command= $path.DIRECTORY_SEPARATOR.'php';
      break;
    }
    if (file_exists($path.DIRECTORY_SEPARATOR.'php.exe')) {
      $php_command= $path.DIRECTORY_SEPARATOR.'php.exe';
      break;
    }
  }

  // Fork PHP, feed script to it
  $p= new Process($php_command, array('-l'));
  
  $in= $p->getInputStream();
  $in->write($source);
  $in->close();
  
  $out= &$p->getOutputStream();
  
  while (!$out->eof()) {
    $l= $out->readLine();
    
    if (preg_match('#^(.*) in - on line (\d+)$#', $l, $match)) {
      Console::writeLine($match[2]);
      Console::writeLine($match[1]);
      exit;
    }
  }
?>

{'fraction_non_alphanumeric': 0.2330345710627401, 'fraction_numerical': 0.002560819462227913, 'mean_word_length': 2.9872448979591835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4877238', 'n_tokens_mistral': 620, 'n_tokens_neox': 604, 'n_words': 102}