You are here: Re: Finding Unused Variables « PHP Programming Language « IT news, forums, messages
Re: Finding Unused Variables

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация