# php-initialized

- Thread: https://externals.io/message/40531
- Original archive: https://news-web.php.net/php.internals/40531
- Started by Jakub Vrana on 2008-09-16T12:31:09+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #40531 — Jakub Vrana — 2008-09-16T12:31:09+00:00

URL: https://externals.io/message/40531#40531

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:

1. `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

2. `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

---

## #40533 — Jakub Vrana — 2008-09-16T15:50:27+00:00

URL: https://externals.io/message/40531#40533

> Looks great! Have been wanting similar behaviour  in the lint
> function for a while. Just the question  is how exhaustive is its
> checking. ( Any checking beyond current is pretty good, no
> complaints there, but just trying to see how useful it is ).

> Brief summary of the sort of situations we can expect to see
> handled and the situations that are currently out-of-scope would be nice.

You are right. I've put it on
http://code.google.com/p/php-initialized/wiki/Features

Jakub Vrána
