❮ Php TÀI LIỆU THAM KHẢO
Thí dụ
In một tin nhắn và chấm dứt tập lệnh hiện tại:
Định nghĩa và cách sử dụng
Hàm chết [] là một bí danh của hàm thoát [].
Cú pháp
Giá trị tham số
thông điệp | Yêu cầu. Một thông báo hoặc số trạng thái để in trước khi kết thúc tập lệnh. Một số trạng thái sẽ không được ghi vào đầu ra, chỉ được sử dụng làm trạng thái thoát. |
Chi tiết kỹ thuật
Không |
4+ |
❮ Php TÀI LIỆU THAM KHẢO
[Php 4, Php 5, Php 7, Php 8]
chết - tương đương với exit
— Equivalent to exit
Sự mô tả
Cấu trúc ngôn ngữ này tương đương với thoát [].exit[].
Hayley Watson ¶ ¶
10 năm trước
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
If a supermarket freezer breaks down, a customer who wanted to buy a tub of ice cream doesn't expect to be kicked out of the building.
atesin gamil com ¶ ¶
7 tháng trước
"... OR DIE..."
[in php, "die" is actually an alias of "exit"]
beware until this is often used as an error handling statement actually isn't... is just the "or" boolean operator overloaded [short circuited]
it won't supress any error message, won't prevent you for fatal errors or crashes, is not an alias for "try/catch", and could has unpredictable results... it just means something like this:
- execute the first statement ""do_something[$with_this]"" normally
-- if the statement results TRUE: no need to execute the second statement so skip it
-- else if returns FALSE... well i am not sure about the result of the whole expression, so continue with second statement ""die['cuack!]""
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
0
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
1
Damien Bezborodov ¶ ¶
13 năm trước
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
3
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
4
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
5
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
6
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
7
Jbailey tại Raspberryginger Dot Com ¶ ¶
15 năm trước
It is poor design to rely on die[] for error handling in a web site because it results in an ugly experience for site users: a broken page and - if they're lucky - an error message that is no help to them at all. As far as they are concerned, when the page breaks, the whole site might as well be broken.
9
Thông tin tại Alzlper Dot Com ¶ ¶
4 năm trước
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
0
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
1
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
2
smcbride tại msn dot com ¶ ¶
1 năm trước
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
4
Stysan ¶ ¶
1 tháng trước
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
5
Ẩn danh ¶ ¶
1 năm trước
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
6
If you ever want the public to use your site, always design it to handle errors in a way that will allow them to continue using it if possible. If it's not possible and the site really is broken, make sure that you find out so that you can fix it. die[] by itself won't do either.
7