Cannot Disable User Programmatically With user_cancel()
Per the docs in user_cancel():


  Since the user cancellation process needs to be run in a batch, either
  Form API will invoke it, or batch_process() needs to be invoked after
  calling this function and should define the path to redirect to.


You need to invoke the batch API in order to trigger the result. 

// Set the notify and cancel type options.    
user_cancel(array(
  'user_cancel_notify' =&gt; TRUE,
  'user_cancel_method' =&gt; 'user_cancel_delete',
), 5, 'user_cancel_delete');

// Invoke the Batch API, disable drupal_goto(), and execute.
$batch = &amp;batch_get();
$batch['progressive'] = FALSE;
batch_process();