How do I retrieve the user ID of the latest editor of a node? I know how to get the user who created a node after getting the node object.

$node = \Drupal::routeMatch()-&gt;getParameter('node');
$uid = $node-&gt;getOwnerId();
$user = \Drupal\user\Entity\User::load($uid);


Since an alternative to retrieving values of the node object is for example $node-&gt;nid-&gt;value, I tried to get the revision user ID this way.

$ruid = $node-&gt;revision_uid-&gt;value;


Unfortunately, this doesn't work, although I see with the Devel module that there is a value. So what is the equivalent in Drupal 8 to $node-&gt;revision_uid in Drupal 7?
$node-&gt;getOwnerID() returns the user ID for the user who created the node. If you need the user who created the revision, you need to use $node-&gt;getRevisionUser(), or $node-&gt;getRevisionUserId() for the user ID.