The job handle is not assigned until the task is received and queued by the job server, so you will need to use one of the client callbacks to access the handle:
<?php
$client->setCreatedCallback(function ($task) {
var_dump($task->jobHandle()); // "H:server:1"
});
$task = $client->addTask('function', 'workload');
var_dump($task->jobHandle()); // ""