[snip] > In the corporate environment with multiple developers we have to > initialize every variable (it's a rule). We even scan code once a day > for variables that have not been declared. It's part of our > documentation.
Jay, is your "scan" something other than setting error reporting to E_ALL? A tool or script that is freely available? [/snip] We use E_ALL, but first we wrote a PHP script that scans for all variables and compares them against the list we have documented. The "new" variables are given by "location" (which .php and line numbers). The dev team then "claims" the variable. If there is no other previously declared variable that "fits the bill" then we included it in the declared list, along with its definition (type and use). If someone just did it out of laziness or made a typo (it happens) they get to recode using the previously declared variable designated for use in this instance. The script itself is fairly straight forward and has a dependency on where you store your variables info (database, text file, etc.). You can write it pretty easily. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php