PHP difference between notice and warning

后端 未结 6 1517
不知归路
不知归路 2020-12-08 10:09

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,

6条回答
  •  孤城傲影
    2020-12-08 10:32

    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."

    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.

提交回复
热议问题