--TEST-- recvmsg(): receive SCM_CREDENTIALS messages --SKIPIF-- [ "path" => $path ], "iov" => ["test ", "thing", "\n"], "control" => [ [ "level" => SOL_SOCKET, "type" => SCM_RIGHTS, "data" => [$sends1, STDIN, STDOUT, STDERR], ] ] ], 0); var_dump($r); checktimeout($s, 500); $data = [ "name" => [], "buffer_size" => 2000, "controllen" => socket_cmsg_space(SOL_SOCKET, SCM_RIGHTS, 4) ]; var_dump($data); if (!socket_recvmsg($s, $data, 0)) die("recvmsg"); if ($data["control"]) { $control = $data["control"][0]; if ($control["level"] == SOL_SOCKET && $control["type"] == SCM_RIGHTS) { foreach ($control["data"] as $resource) { if (!is_resource($resource)) { echo "FAIL RES\n"; var_dump($data); exit; } } echo "OK"; } else { echo "FAIL RIGHTS\n"; var_dump($data); exit; } } else { echo "FAIL CONTROL\n"; var_dump($data); } --EXPECTF-- creating send socket resource(%d) of type (Socket) creating receive socket resource(%d) of type (Socket) bool(true) int(11) array(3) { ["name"]=> array(0) { } ["buffer_size"]=> int(2000) ["controllen"]=> int(%d) } OK