Die () Stop program run, output content
Exit is to stop the program from running, not output content
Return is the returned value
Die is not stopped until it encounters an error
Exit is stopped directly and no subsequent code is run, and exit () can display the content.
Return is a purely returned value, but no subsequent code will be run
Exit (0): Run the program normally and exit the program;
Exit (1): Abnormal operation results in exiting the program;
Return (): Returns a function that, if in the main function, exits the function and returns a value.
Detailed said:
1. Return returns the function value, which is the keyword; exit is a function.
2. Return is a language level that represents the return of the call stack, and exit is the system call level, which represents the end of a process.
3. Return is the exit of the function (return); Exit is the exit of the process.
4. Return is provided by the C language, and exit is provided by the operating system (or given in the function library).
5. Return is used to end the execution of a function, using the execution information of the function out of other calling functions; the exit function exits the application, deletes the memory space used by the process, and returns a state of the application to the OS, which identifies some of the application's operational information. This information is related to the machine and the operating system, usually 0 for normal exit, not 0 for abnormal exit.
The difference between die (), exit (), and return in PHP