[Split] the difference between exit () and die

Source: Internet
Author: User
[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! ------ Solution ------------------ the manual clearly states that the die & nbsp;-& nbsp; is equivalent to & nbsp; exit () ------ solution [split] exit () differences from 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!
------ Solution --------------------
The manual makes it clear that

Die-equivalent to exit ()

------ Solution --------------------
There is no difference in interruptions, by the way.
------ Solution --------------------
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?
------ Solution --------------------
Use exit () and die () to find it hard to hear ~~
Paste it to the score ~~

------ Solution --------------------
Generally, exit () is used, and die is used occasionally. the actual difference has not been further explored.
------ Solution --------------------
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.


------ Solution --------------------
The difference between a prostitute and a bitch...
------ Solution --------------------
Reference:
The difference between a prostitute and a bitch...

Haha what is the difference between a prostitute and a lady?
------ Solution --------------------
Come on, I will pick up the score. In fact, I don't know. a newbie is passing.
------ Solution --------------------
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
------ Solution --------------------
Upstairs solution ~~~~~~~~~
------ Solution --------------------
Pick up the score.
------ Solution --------------------
Xu moderator Wei Wu!
------ Solution --------------------
Getting used to exit
------ Solution --------------------
Fast checkout
------ Solution --------------------
Alias, no difference
------ Solution --------------------
I prefer die

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.