$code) { if (false !== strpos($code, '@@{')) { // Skip tests with evaluate segments continue; } list($name, $tests) = $testParser->parseTest($code, 2); $newTests = []; foreach ($tests as list($modeLine, list($input, $expected))) { $modes = $codeParsingTest->parseModeLine($modeLine); $parser = $codeParsingTest->createParser($modes['version'] ?? null); list(, $output) = $codeParsingTest->getParseOutput($parser, $input, $modes); $newTests[] = [$modeLine, [$input, $output]]; } $newCode = $testParser->reconstructTest($name, $newTests); file_put_contents($fileName, $newCode); }