pcntl_setns
(PHP 8 >= 8.4.0)
Reassociate the calling process with a namespace of another process
Description
Reassociates the calling process with a Linux namespace of the process specified by process_id, using a pidfd obtained via pidfd_open(2) and setns(2).
Parameters
process_idThe process ID of the target process whose namespace to join. If null, the calling process's own PID is used.
nstypeThe namespace type to reassociate with. Defaults to
CLONE_NEWNET(network namespace). Possible values includeCLONE_NEWNET,CLONE_NEWIPC,CLONE_NEWUTS, and others.
Return Values
Success