問題描述
在編寫代碼錯誤時,可能會出現(xiàn)警告和通知.我知道錯誤背后的想法.我想有一個警告是為了通知您可能導致錯誤的事情,但通知不一樣嗎?我想通知不是做正確事情的消息;)
When writing code errors, warnings and notices can occur. I know the idea behind errors. I suppose a warning is there to inform you about something that can cause an error, but isn't a notice exaclty the same? I suppose a notice is not a message of something doing right ;).
這讓我有點困惑.誰能說出這兩者之間的區(qū)別以及應(yīng)如何處理這些消息.
It's just a bit confusing to me. Can anybody tell the difference between those two and the way these messages should be treated.
推薦答案
通知是一條咨詢消息,意思是你可能不應(yīng)該做你正在做的事情,但無論如何我會讓你做"
A notice is an advisory message meaning "You probably shouldn't be doing what you're doing, but I'll let you do it anyway"
警告是一條消息,表示您做錯了一些事情,很可能在未來導致錯誤,所以請修復它."
A warning is a message saying "You are doing something wrong and it is very likely to cause errors in the future, so please fix it."
通知和警告都不會停止您的腳本的執(zhí)行,盡管我鼓勵您認真對待它們并努力在您的應(yīng)用中沒有任何通知.
Both notices and warnings will not halt execution of your script, although I would encourage you to take them seriously and strive to have not even one notice in your apps.
這篇關(guān)于通知和警告之間的 PHP 區(qū)別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!