I have noticed that in PHP (7.x), when you write to a file, it overwrites any existing characters. For example,
$file