What is die in php
This article mainly explains "what is die in php". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is die in php".
In PHP, die is a miscellaneous function that outputs a message and exits the current script with the syntax "die (status)"; this function is an alias for the exit () function, where arguments specify the message or status number written before exiting the script.
Operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer
What does die mean in php
The die () function outputs a message and exits the current script.
This function is an alias for the exit () function.
Grammar
Die (status)
Status is required. Specifies the message or status number written before exiting the script. The status number is not written to the output.
Description
If status is a string, the function outputs the string before exiting.
If status is an integer, this value is used as the exit state. The value of the exit status is between 0 and 254. The exit status of 255 is reserved by PHP and will not be used. Status 0 is used to successfully terminate the program.
Tips and comments
Note: if the version number of PHP is greater than or equal to 4.2.0, this parameter will not be output if status is an integer.
Thank you for your reading, the above is the content of "what is die in php". After the study of this article, I believe you have a deeper understanding of what the die in php is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!