4) { $arglen = $argc - 1; exit("Expected 3 to 4 arguments (got ${arglen}): [payload]\n"); } // Connect to the socket server $client = new Client($argv[1], null, Connection::AF_UNIX); // Get endpoint, method, and optional payload $args = $argv; array_shift($args); array_shift($args); // Restore enum from argument $args[1] = Method::from(strtoupper($args[1])); // Call endpoint and echo result $call = $client->call(...$args); echo json_encode($call) . "\n";