More toroughly checking a script before execution

From: Date: Thu, 21 Jul 2005 22:50:43 +0000
Subject: More toroughly checking a script before execution
Groups: php.general 
Request: Send a blank email to php-general+get-219163@lists.php.net to get a copy of this message
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

« previous php.general (#219163) next »