'Can a suffixed file extension be bypassed for file_get_contents?

I have this code which allows a text file to be read

<?php
if (isset($_GET['id'])) {
    $file = $_GET['id'] . ".txt";
    echo file_get_contents($file);
}
?>

It is possible to perform directory traversal, but is it possible for files ending with a file extension other than .txt to be read and sent?

I am aware that this question has already been answered, but it was asked in 2012, long after the nullbyte exploit has been patched. So I'm wondering if it is still possible to this day.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source