Hello!
PHP allows to work with uninitialized variables. E_NOTICE
error level
can be used to warn before it but this is not perfect for two reasons:
-
E_NOTICE
doesn't warn before adding elements to uninitialized
arrays. It is further explained by Etienne Kneuss:
http://www.colder.ch/news/09-09-2005/4/another-example-showing-t.html -
E_NOTICE
is emitted in a run-time and not in a compile-time which
can be late (the error is spotted in the same time as abused).
To solve both problems, I've developed a program checking the usage of
uninitialized variables from outside the script without running it:
http://code.google.com/p/php-initialized/
Maybe the same concept can be used in the PHP compile-time.
Jakub Vrana