PHP Classes

Syntax Check: Check the syntax of PHP scripts

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 46%Total: 455 All time: 6,128 This week: 555Up
Version License PHP version Categories
syntax-check 1.0MIT/X Consortium ...5PHP 5, Testing


This class can check the syntax of PHP scripts.

It can traverse a given directory recursively to find files with the .php syntax.

The class can execute the PHP command line program version to check if the syntax of each of the PHP scripts that were found.

Innovation Award
PHP Programming Innovation award nominee
December 2012
Number 8

Prize: One downloadable e-book of choice by O'Reilly
Sometimes it is necessary to make changes in PHP applications, eventually to fix bugs and other issues.

Ideally the changed code should go through a series of tests to make sure the changes do not break any aspect of the applications functionality.

However, sometimes there is not much time to go through extensive tests. Often the changes are too small to expect major functionality breaking.

Still it is prudent to make sure that you are not breaking your code due to small syntax mistakes.

In that case the changed code should go at least through minimal testing that assures that the syntax of the code is not broken.

The PHP command line version program supports a lint mode that can do basic syntax checking without executing the code.

This class acts as a wrapper to perform such test using this feature of the PHP command line version command.

Manuel Lemos
Picture of Eper Kalman
Name: Eper Kalman <contact>
Classes: 10 packages by
Country: Serbia Serbia
Age: 48
All time rank: 7525 in Serbia Serbia
Week rank: 286 Up3 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example example script
Plain text file SyntaxCheck.class.php Class main class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,128
This week:555Up
 User Ratings  
 All time