public function changeNYM() { // Connect to the TOR server using password authentication $tc = new TorControl(['hostname' => 'localhost', 'port' => 9051, 'password' => 'new_tor_password', 'authmethod' => 1]); $tc->connect(); $tc->authenticate(); $res = $tc->executeCommand('SIGNAL NEWNYM'); echo getColoredMessage('NYM: ' . $res[0]['code'] . ': ' . $res[0]['message'] . PHP_EOL, 'warning'); $tc->quit(); }