Strange behaviour with file_get_contents/file_put_contents

Wanted to write a quick one liner to count page loads, not worrying about users, sessions or refreshes, and tried this:

file_put_contents(“page.test”, ((file_get_contents(“page.test”))+1));

echo “Test:”.file_get_contents(“page.test”);

On every load or refresh, the page.test file increases by 3, not 1 which I expected. If I write each step as a separate line of code and use a counter variable as an intermediate step, then it all works as expected, but the one liner goes up 3 at a time.

Appreciate some wisdom from the experts! Thank you. Ray