|
Posted by Markus Fischer on 07/22/05 01:50
Hi,
is there a way to have a more torough checking of PHP code before executing?
I can't remember the number of times when I try to read a variable which
hasn't assigned a value yet. This increases as projects are getting
bigger and more files are used.
I know that due it's loosely typed nature, it wouldn't be possible to
detect things like this:
$foo = "bar";
$$foo = "baz";
echo $bar;
but that would be okay with me. At least it should catch things like
_before_ starting execution:
- read variables not assigned a value before
- verify that a function/method is actually defined
I'm willing to accept a longer time PHP starting up because of this. I'm
seeing it's main usefulness when using with the cli application to have
it ran on code before it goes live or something.
This would speed up testing dramatically, as it wouldn't be necessary to
go through all test paths just to realize that a function/method call
was misspelled or so. Basically it's like the compiling stage done in
e.g. Java (oh no, did I wrote the J.. word? ;).
I'm also aware that certain modern IDEs provide lookup
features/introspecton at least for function/methods, but unfortunatley
it's not everyones favourite.
thanks for any pointers,
- Markus
Navigation:
[Reply to this message]
|