3v4l.org

run code in 300+ PHP versions simultaneously
<?php class streamWrapper { public function stream_lock($operation ) { var_dump($operation); } public function stream_open($path, $mode, $options, $opened_path) { var_dump($path); return fopen('/tmp/waa', $mode); } } stream_wrapper_register('test', 'streamWrapper'); $fp = fopen('test://waa', 'w+'); var_dump([LOCK_EX, LOCK_SH, LOCK_NB, LOCK_UN]); flock($fp, LOCK_EX | LOCK_NB);

preferences:
44.8 ms | 402 KiB | 5 Q