PHP.nl

win32_set_service_exit_code

win32_set_service_exit_code

Define or return the exit code for the current running service

int **win32_set_service_exit_code** int $exitCode

Change or return the exit code. The exit code is used only if the exit mode is not graceful. If the value is not zero, the recovery configuration can be used after service fail. See

for more details Microsoft system error codes

Let op: > This function work only in "cli" SAPI. On other SAPI this function is disabled.

exitCodeThe return code used on exit.

Return the current or old exit code.

Prior to version 1.0.0, if the SAPI is not , this function emits an level error. "cli"``E_ERROR

As of version 1.0.0, will throw a 
 if SAPI is not 

Win32ServiceException``"cli"

win32_start_service_ctrl_dispatcher``win32_set_service_status``win32_set_service_exit_mode