Home/
 www.icosaedro.it 

 PHPLint

Current version: 0.9_20090802

PHPLint is a validator and documentator for PHP 4 and PHP 5 programs. PHPLint extends the PHP language through transparent meta-code that can drive the parser to a even more strict check of the source. PHPLint is not simply a checker: it implements a new, strong typed, language implemented over the PHP language. You can build your programs from scratch with PHPLint in mind, or you can check and fix existing programs, or you can follow the quick-and-dirty PHP programming way and then add the PHPLint meta-code later once the program is finished. Whatever is the strategy you choose, PHPLint can improve your programming work.

A binary executable version of PHPLint for Windows is finally available: please visit this page for details.


PHPLint working scheme

PHPLint is an analyzer of PHP sources that implements its own, independent scanner and parser. All the informations collected from the sources are also used to generate the documentation. PHPLint ensures these documents reflect the actual content of the sources from which they were derived.


Features

  • Supports both PHP 4 and PHP 5.
  • Namespaces (PHP≥5.3).
  • Enforces safety through strong-typed data programming.
  • Reports PHP extension modules actually used, useful information for the final deployment of the application on the target system.
  • Detects syntactic errors, unassigned/misspelled variables, unused items, unreachable code.
  • Performs flow analysis with detection of variables not definitely assigned and unreacheable code.
  • Checks proper usage of the signature for functions and methods.
  • Checks OOP inheritance and overriding rules, including signature and inherited exceptions.
  • Supports class autoloading.
  • Supports checked and unchecked exceptions.
  • General enforcement of safety and security.
  • Supports for phpDocumentor DocBlocks.
  • Generates HTML documentation from the sources.

...and much more. Please read the tutorial to learn more about how PHPLint works and can be used, and try the examples with the PHPLint on-line interface to PHPLint. The manual is the definitive guide to PHPLint.


PHPLint graphical interface

Usually programmers use the command line version of PHPLint, suitable to be included in scripts to be executed routinary. The distributed package also includes phplint.tk, a program that provides a practical graphical user interface to the numerous options of PHPLint. Click for a larger view.


How to continue from here

Documentation:
Tutorial
Reference Manual
Support for phpDocumentor
Documentator Reference Manual
FAQ (Frequently Asked Questions)
License
Modules
Browseable list of the PHP built-in modules generated by the PHPLint Documentator. Here, for example, you can search in which PHP extension a given function is defined, and what arguments exactly it has.
PHPLint on-line
The WEB version of PHPLint. Here you can test simpler programs that do not require the inclusion of external sources. Some examples are also available.
Bugs, missing features and to-do list
Latest changes
Detailed description of the additions, corrections and changes to the latest released version of the program.
Download the program
PHPLint is available as a stand-alone program you can execute on your computer. This is the preferred way to use PHPLint since it is faster and it allows to parse recursively the included packages and complete applications.

Umberto Salsi

Contact
Site map
Home/

An abstract of the last comments from the visitors of this page follows. Please, use the Comments link above to read all the messages or to send your contribute.

2010-07-06 by Umberto Salsi
Re: Simplexml
Anonymous wrote: [...] The problem are the dynamically created properties, that are not supported by PHPLint (and never will be). Instead you can try to convert the $xml object into an array with $a = get_object_vars($xml); which returns a generic associative array of mixed values. This adds a little overhead due to unnecessary (for PHP) creation of another array that duplicates data that are [...]

2010-07-05 by Anonymous
Simplexml
Nice product! I have successfully run all my scripts through phplint, except for the following. I execute a web service, then process the output: $xml = simplexml_load_file(whatever); $answer = $xml->Result->Answer; That second line results in 2 messages: ERROR: property `SimpleXMLElement::$Result' does not exist or not visible Warning: `->' operator applied to a value of type unknown The script [...]

2010-05-18 by Anonymous
Ignoring certain code
Hi, First, congratulations on PHPLint. I love static code checkers, they make the developer's life much easier! Is it possible (perhaps by means of specially formatted comments) to ignore certain parts of a document, for example for machine generated code or something like that? //G

2010-02-24 by Umberto Salsi
Re: parent classes
Anonymous wrote: [...] You may look at the "Importing packages" chapter of the reference manual where the recommended layout of the whole source program is explained. In few words, every class file should import all the classes it depends upon. Then in your case: require_once 'cParent.php'; class cChild extends cParent { ... }

2010-02-24 by Anonymous
parent classes
Hello, First at all: tnx a lot for PHPLint! I use PHPLint to analyze a large set of php classes. It's of great help when looking for potential bugs. I have a problem when PHPLint parses classes that make reference to their parents. For example for: class cChild extends cParent { public function __construct() { parent::__construct('mode'); } ... } PHPLint says: FATAL ERROR: invalid `parent::': [...]

2010-01-04 by Umberto Salsi
Re: order of methods?
Anonymous wrote: [...] Currently already the WEB pages of PHPLint receive hundreds of distinct visitors every day, with several backlinks from other important WEB sites. So, as far as PHPLint is gaining more and more popularity, it is simple for any interested programmer to find this tool on The Net without difficulty either searcing for "PHP validation" or "PHP static analysis" or even "PHP [...]

(...)