← All docs

flock()

Portable advisory file locking.

flock()

function flock(resource $stream, int $operation, bool $would_block = null): bool

Portable advisory file locking.

Parameters:

  • $stream (resource)
  • $operation (int)
  • $would_block (bool), passed by reference, default null, optional

Returns: bool

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how flock is implemented in the compiler, see the internals page.