I have function like this:
class Service { function delete_user($username) { ... $sessions = $this->config->sessions; $t
You can just cast it to something else:
$a = $this; $this->config->sessions = array_filter($sessions, function($session) use ($a, $username){ return $a->get_username($session->token) != $username; });
You'll also need to pass $username through otherwise it'll always be true.
$username