I am posting this not about code error but about possible conflict using this piece of code:
$logFile = 'data.log';
$result = (int) file_get_contents($logFile) + 1;
file_put_contents($logFile, $result);
This will read a file called data.log and get it's number and write this number +1. But, I will run this application with many users calling this in realtime (like 100 users per second).
So, I want to know if this will create some conflict, get outupdated number and store wrong data or something like this. Is it possible? Are there an way to I avoid it?
Thank you.