for reuse and easier reading, i would do:
$isValidIdFormat = !empty($id) || 0 === $id;