← All docs

readdir() — internals

Compiler internals for readdir(): lowering path, type checks, and runtime helpers.

readdir() — internals

Where it lives

Lowering notes

  • Lowers readdir(dir_handle) for libc, glob, and userspace-wrapper handles.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_closedir
  • __rt_readdir
  • __rt_user_wrapper_dir_closedir
  • __rt_user_wrapper_dir_readdir

Signature summary

function readdir(resource $dir_handle): mixed

What the type checker enforces

  • Arity: takes exactly 1 argument.

Eval interpreter (magician)

Cross-references