3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $f = fopen("lock", "w") or die("Cannot create lock file."); if(!flock($f, LOCK_EX | LOCK_NB)) { print ("Exiting due to duplicated instance."); exit(); } print("1"); sleep(20);
Output for 5.6.38 - 7.2.11, 7.3.0rc1 - 7.3.0rc3
Warning: fopen(): open_basedir restriction in effect. File(lock) is not within the allowed path(s): (/tmp:/in:/etc) in /in/IHENP on line 3 Warning: fopen(lock): failed to open stream: Operation not permitted in /in/IHENP on line 3 Cannot create lock file.
Output for 7.3.0alpha1 - 7.3.0beta3
Warning: fopen(lock): failed to open stream: Permission denied in /in/IHENP on line 3 Cannot create lock file.