function task() { try { (yield SystemCall::killTask(500)); } catch (Exception $e) { echo 'Tried to kill task 500 but failed: ', $e->getMessage(), "\n"; } }