PHP difference between notice and warning

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 ;).

It's just a bit confusing to me. Can anybody tell the difference between those two and the way these messages should be treated.


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.


Differences are explained here: http://www.php.net/manual/en/errorfunc.constants.php

Specifficaly:

Errors:

Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted.

Warnings:

Run-time warnings (non-fatal errors). Execution of the script is not halted.

Notices:

Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script.