|
Posted by Umberto Salsi on 10/12/05 11:33
ralphNOSPAM@primemail.com wrote:
> Is there a PHP script that can find unused variables? I'd like to
> 'clean up' my scripts.
$ cat test.php
<?
$a = 1;
class A{}
function f($b, $c)
{ $d = $b; }
?>
$ phplint --print-context text.php
function f($b, $c)
\_ HERE
6: notice: undefined type for argument `$b'. I will assume `mixed'. Hint:
either use an explicit type (example: `/*.int.*/ $b') or assign a default
value (example: `$b=123').
function f($b, $c)
\_ HERE
6: notice: undefined type for argument `$c'. I will assume `mixed'. Hint:
either use an explicit type (example: `/*.int.*/ $c') or assign a default
value (example: `$c=123').
7: notice: variable `$d' assigned but never used
6: notice: variable `$c' assigned but never used
6: notice: guessed signature of the function `f' as void(mixed, mixed)
2: notice: variable `$a' assigned but never used
6: notice: unused function `f'
4: notice: unused class `A'
Overall test results: 0 errors, 0 warnings.
Regards,
___
/_|_\ Umberto Salsi
\/_\/ www.icosaedro.it
[Back to original message]
|