wp-includes/pomo/po.php:457$fresource$actionstringoptional'read'bool public function read_line( $f, $action = 'read' ) { static $last_line = ''; static $use_last_line = false; if ( 'clear' === $action ) { $last_line = ''; return true; } if ( 'put-back' === $action ) { $use_last_line = true; return true; } if ( $use_last_line ) { $line = $last_line; } else { $line = fgets( $f ); if ( false === $line ) { return $line; } // Handle \r-only terminated lines after the deprecation of auto_detect_line_endings in PHP 8.1. $r = strpos( $line, "\r" ); if ( false !== $r ) { if ( strlen( $line ) === $r + 1 && "\r\n" === substr( $line, $r ) ) { $line = rtrim( $line, "\r\n" ) . "\n"; } else { // The lines are terminated by just \r, so we end the line there and rewind. $rewind = strlen( $line ) - $r - 1; $line = substr( $line, 0, $r ) . "\n"; fseek( $f, - $rewind, SEEK_CUR ); } } } $last_line = $line; $use_last_line = false; return $line; }Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/pomo/po.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.