[Split] the difference between exit () and die 1. what are the essential differences between exit () and die?
2. which one do you often use during coding or project debugging?
3. is exit () or die used for convenience or other reasons?
Let's talk about it!
By the way, scatter points!
Reply to discussion (solution)
The manual makes it clear that
Die? Equivalent to exit ()
There is no difference in interruptions, by the way.
The die () function outputs a message and exits the current script.
This is the alias of the exit () function.
Why is this meaningless thing tangled?
Use exit () and die () to find it hard to hear ~~
Paste it to the score ~~
Generally, exit () is used, and die is used occasionally. the actual difference has not been further explored.
The die () function outputs a message and exits the current script.
This is the alias of the exit () function.
If status is a string, the function outputs the string before exiting.
If status is an integer, this value is used as the exit status. The exit status ranges from 0 to 254. Exit status 255 is retained by PHP and will not be used. Status 0 is used to successfully terminate the program.
If PHP version is later than or equal to 4.2.0, this parameter is not output when status is an integer.
The difference between a prostitute and a bitch...
The difference between a prostitute and a bitch...
Haha what is the difference between a prostitute and a lady?
Come on, I will pick up the score. In fact, I don't know. a newbie is passing.
Exit () is different from die.
Die () stops running the program and outputs the content
Exit indicates that the program is stopped and no content is output.
Die stops only when an error occurs.
Exit is to stop directly without running the subsequent code. exit () can display the content.
Exit (0): The program runs normally and exits;
Exit (1): exit the program due to abnormal operation;
As to whether it makes sense, you can understand it only when it is used in the project...
Exit is the same as die.
Exit follows the c language, and die is unique to php.
Php recommends that you use die, but the author of the php manual reversed them.
Convert exit to the synonym of die.
The primary and secondary components are upside down, making people feel that the die is dispensable.
Actually not.
Many php practitioners switch over asp, and exit commands jump out of the loop in vbs instead of terminating the program.
Continuing to use exit is not conducive to the approval of php
Upstairs solution ~~~~~~~~~
Pick up the score.
Xu moderator Wei Wu!
Getting used to exit
Fast checkout
Alias, no difference
I prefer die