Chapter 11, pg. 301, contains the following text:
If you are running PHP 5.1 or greater, you can add the LOCK_EX constant as the third argument to
file_put_contents():
file_put_contents($file, $data, LOCK_EX);
To use both the LOCK_EX and FILE_APPEND constants, separate them with the binary OR operator (|):
file_put_contents($file, $data, FILE_APPEND | LOCK_EX);
It doesn’t matter in which order you list the two constants.
This is a really interesting solution, and I'm surprised my mind didn't registered it when I was reading that book for the first time.
Could s