Important if using this to lock a class into a single instance (long duration processes). The file handle needs to be a class wide variable like $this->singleinstance. Not local to the __construct function like $localvariable. The reason is the local variable is gone after __construct is called so the lock lasts for only millisconds and not for the full duration of class running in memory.