You are here: [Announce] PHPLint 0.5 - PHP source validator and documentator « PHP Programming Language « IT news, forums, messages
[Announce] PHPLint 0.5 - PHP source validator and documentator

Posted by Umberto Salsi on 01/25/06 21:00

PHPLint is a validator and documentator for PHP programs. PHPLint checks
the syntax of statements and expressions, check the proper usage of
data types and promote a clean programming style. The programmer can
add to the source the PHPLint meta-code, that enhance the syntax of
the PHP language toward the paradigm of a strong-typed language and
safe programming (see the example below).


NEW IN THIS VERSION

(This is only a summary of the main new features. For a complete list,
please check http://www.icosaedro.it/phplint/manual.html?p=changes ).

+ PHP 4: new meta-code attributes /*. public|protected|private static
final .*/ for class variables and class functions.

+ PHP 5: abstract classes, interface classes now implemented.

+ PHP 5: track-down the propagation of the thrown exceptions and raise
warning if not handled.

+ PHP 5, Documentator: now it reports thrown exceptions and inherited
unhandled exceptions.

+ New concept of "package" where private constants, vars, funcs and classes
can be made explicitly /*.private.*/. PHPLint raise an error if these
private items are used outside their package:

/*. private .*/ define('MAX_USERS', 100);
/*. private .*/ $logged_users_count = 0;
/*. private .*/ class UsersStuff { ... }

Ok, the poor-man "namespace" feature, but effective.

+ Reports modules (aka "PHP extensions") required but not used.

+ Reports packages required but not used.

+ Track-down the propagation of the triggered errors and raise warning if not
handled.

+ Documentator:
reports triggered errors and inherited unhandled errors
reports items inherited from parent classes
reports exceptions thrown by functions and methods


INTENDED AUDIENCE
Dedicated to all the programmers that appreciate the PHP language for
fast program development, but regret the safety that a strong typed
language can give.


SIMPLE (UNUSEFUL) EXAMPLE

<?php
/*. require_module 'standard'; .*/

class Option
/*. DOC Store an element of an OPTION. .*/
{
public /*. int .*/ $key;
public /*. string .*/ $value;

public /*. void .*/
function __construct(/*. int .*/ $key, /*. string .*/ $value)
{ $this->key = $key; $this->value = $value; }
}


/*. void .*/ function EchoOptions(/*. array[int]Option .*/ $opts)
/*. DOC Displays a list of OPTIONs. .*/
{
for($i = 0; $i < count($opts); $i++)
echo "<OPTION value=", $opts[$i]->key, ">",
htmlspecialchars($opts[$i]->value), "</OPTION>\n";
}

echo "Your preferred color: <SELECT name=color>\n";
$c = array( new Option(1, "red"),
new Option(2, "green"),
new Option(3, "blue") );
EchoOptions( $c );
echo "</SELECT>\n";
$_SESSION['color_table'] = $c;
?>


AVAILABILITY
PHPLint is available either as M2 source (it requires the M2 Development
System), as a pure-C source resulting from the M2-to-C cross compiler
(it requires a C compiler), and as an on-line WEB interface.

PHPLint WEB SITE
http://www.icosaedro.it/phplint/

LICENSE
BSD-style.

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

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