Home / Section index

 PHPLint Download

The distributed package consists of a collection of PHP source programs and PHP libraries that implement PHPLint. In order to execute PHPLint, you will need the PHP CLI (Command Line Interpreter) version 5.6+ or 7.0+ as detailed in the README.txt file, so that PHPLint can run on any computer for which a PHP interpreter is available.

File Size Description
phplint-4.2.0_20200308.zip 2517 KB The whole PHPLint project, including libraries and documentation with line-ending of the files encoded for Windows (that is, \r\n). Note how this ZIP file is larger than the TAR.GZ file below due to the way the ZIP format works when many small files are involved: in fact, file names per se are not compressed.
phplint-4.2.0_20200308.tar.gz 1915 KB The whole PHPLint project, including libraries and documentation with line-ending of the files encoded for Unix, Linux, Mac OS X (that is, \n). This file is smaller than the corresponding ZIP format for the reasons explained above, but apart from that its contents are exactly the same.
CVS -- Repository of the PHPLint project. From here you can download PHPLint in its current development status; the CHANGES.txt file summarizes the latest changes. Click on the link Download this directory as GNU tarball to download the whole content of the directory, or use a CVS client to access the repository as detailed below.

To install PHPLint in your Composer-based project add the PHPLint package repository to the composer.json file:

	"name": "myvendor/mypackage",

	...more stuff of your project here...

	"repositories": [
			"type": "composer",
			"url": "https://www.icosaedro.it/phplint"
and then require the icosaedro.it/phplint package:
$ php composer.phar require icosaedro.it/phplint

PHPLint is also available from the CVS repository. If you want to experiment with PHPLint in its development status and keep constantly updated, accessing the repository with a CVS program is the way to go. On Windows, you may install a CVS client program (for example from http://www.cvsnt.org) then type these commands from the terminal:

C:\> set CVSROOT=:pserver:anonymous:@cvs.icosaedro.it/home/cvs/repo
C:\> cd myprograms
C:\myprograms> cvs checkout phplint
and later, to check for updates:
C:\> cd c:\myprograms\phplint
C:\myprograms\phplint> cvs update -dP
On Unix/Linux:
$ export CVSROOT=:pserver:anonymous:@cvs.icosaedro.it/home/cvs/repo
$ cd myprograms
$ cvs checkout phplint
and later, to check for updates:
$ cd myprograms/phplint
$ cvs update -dP

Umberto Salsi
Site map
Home / Section index
An abstract of the latest comments from the visitors of this page follows. Please, use the Comments link above to read all the messages or to add your contribute.

2018-05-10 by Umberto Salsi <salsi@icosaedro.it>
Re: OS X 10.8
Guest wrote: [...] The old times of PHPLint 1 (when the program was cross-compiled from M2 to C with all the implied problems) are finally over; since PHPLint 2 and now with PHPLint 3 it's all PHP source code so there is nothing to compile anymore, only the PHP CLI is required. Regards, - Umberto Salsi[more...]

2013-12-04 by Guest
Re: OS X 10.8
Anonymous wrote: [...] (PLEASE ADD YOUR COMMENTS HERE) This link is dead, do you have another copy of the phplint configure script? thanks [more...]

2013-12-04 by Guest
Re: Mac OS X: gcc now deprecated
Umberto Salsi wrote: [...] (PLEASE ADD YOUR COMMENTS HERE) This isn't working for me. Did you have to install clang? I am using osx version 10.8.4 thanks[more...]

2013-11-28 by Umberto Salsi
Mac OS X: gcc now deprecated
Thanks to Harald Lapp that send me a patch to fix an error given by Mac OS X that now deprecates gcc in favor of clang. As a temporary fix, Mac OX X users may compile the "pure-C" package by temporarily change the "cc" command, something like $ alias cc=clang $ ./compile Future releases of the pure-C package will contain the fix. [more...]

2013-11-02 by Guest
The -lgc linker option in ./compile should be moved to the end
I have just compiled phplint on Ubuntu although it gave me some trouble. The warning about libcg.so in WARNING: gc.h or libcg.so missing or unexpected library path. confused me a bit at first, but I figured out that libgc.so was what was meant, so I went ahead and installed the necessary headers: $ sudo apt-get install libgc-devel Running ./compile to build the library still gave a bunch of linker errors: phplint.c:(.text+0x106): undefined reference to `GC_malloc' ... Eventually I figured out that I had to replace the line cc -lgc src/phplint.c -o src/phplint in ./compile with cc src/phplint.c -o src/phplint -lgc because of a change in GCC discussed here: http://stackoverflow.com/questions/12734161/how-to-use-boehm-garbage-collector-in-ubuntu-12-04 [more...]

2013-05-21 by Umberto Salsi
Re: Problem on casting
Anonymous wrote: [...] Add error displaying or error logging to your configuration too see the actual error message. You may either do this from php.ini or from code. [...] PHPLint has nothing to do with Javascript and the "standard PHPLint library" does not contain a single line of Javascript. So the issue is due to something else. [...] I may suggest to start with some simpler, working example, avoiding variable-variables ($$var) that are forbidden by PHPLint, and avoiding generic mixed arrays -- always specify the type of the elements and the type of the index or let PHPLint guess the type of the array from the elements given: $my_arr1 = /*. (SomeType[int]) .*/ array(); $my_arr2 = array("x", "y"); $my_arr3["z"] = 123; Moreover, array functions array_* are usually difficult to use with PHPLint because the type of the result cannot be statically determined, so prepare yourself to write some explicit "foreach()" loop. Hope this may help. [more...]

2013-05-19 by Guest
Problem on casting
I have wamp server. Apache version: 2.2.22 php version 5.3.13 I use mysqli for queries. copied phpl.bat to my site folder (also copied stdlib - is that enough?) add on phpl.bat the line : set base=C:\phpl\ (where is the real folder of phplint). I add on code: require_once __DIR__ . "/stdlib/cast.php"; when I do cast like : cast("mysqli_result", mysql_result->query("select ...")); the code is compiled properely, but when running it, php hang (why?) I realized that any reference in my old javascript code to : settimeout (function() { ...}, 10000); - timeout not work, and I have seen of some workarround, that it maybe of synchornized ajax (I am using ajax. where it is synchronized there is no time out. That's nothing I have changed). Does php lint change some configuration to php synchronized? anyway I am using also : call_user_func_array for manipulating the mysqli_stmt::bind_param, and I don't have any example that works with propare compilation - any help will be appreciated. Here is s[...][more...]

2013-02-23 by Guest
Re: OS X 10.8
Anonymous wrote: [...] Hi, It's due to wrong compiler settings in the configure / compile scripts. I've already altered them so it's now compilable under Mac OSX 10.8. You need to have installed the Mac Ports package and the 'boehmgc-devel' package from it. http://www.nimasystems.com/other/prog/phplint/fixed_phplint-configure-scripts.tar[more...]

2012-11-18 by Guest
OS X 10.8
Do you know, how to compile phplint in 10.8 os x?[more...]

2012-07-31 by Steve H
PHPLint Fails to Interpret PHP in <script> tags
I have an app installed that uses <script language="PHP"> ... </script> to denote PHP code rather than the standard <?php ... ?> boundaries. (I've never seen this before) The PHPLint binary reports: Warning: no PHP code found at all[more...]

2012-06-24 by Umberto Salsi
Re: PHPLint: unable to compile under Ubuntu 11.10 x86_64 and PHP 5.4
Anonymous wrote: [...] It's a linking problem due to an incomplete installation of the GC library: the libgc library was not found. Probably you did not updated the libraries cache - as root user, try with the command: $ ldconfig then check if the libgc library appears in the cache: $ ldconfig -p | grep libgc and finally re-compile PHPLint. [more...]

2012-06-24 by Guest
Re: PHPLint: unable to compile under Ubuntu 11.10 x86_64 and PHP 5.4
Hi, I tried to go one better (Ubuntu 12.04, 64-bit) and install libgc-dev. Now the GC-related warnings are gone, but they are replaced by errors :-( Configuration file 'include/missing.c' successfully generated. Compiling... /tmp/cc4nY6oR.o: In function `M2_MALLOC': phplint.c:(.text+0x10f): undefined reference to `GC_malloc' /tmp/cc4nY6oR.o: In function `M2_MALLOC_ATOMIC': phplint.c:(.text+0x142): undefined reference to `GC_malloc_atomic' /tmp/cc4nY6oR.o: In function `M2_REALLOC': phplint.c:(.text+0x180): undefined reference to `GC_realloc' /tmp/cc4nY6oR.o: In function `m2_input': phplint.c:(.text+0x1b64): undefined reference to `GC_free' /tmp/cc4nY6oR.o: In function `main': phplint.c:(.text+0x4ceba): undefined reference to `GC_init' collect2: ld returned 1 exit status Thanks, Yaron Umberto Salsi wrote: [...] (PLEASE ADD YOUR COMMENTS HERE) [more...]

2012-04-22 by Umberto Salsi
Re: PHPLint: unable to compile under Ubuntu 11.10 x86_64 and PHP 5.4
Anonymous wrote: [...] Hi Ilan, you should now run the ./compile script to generate the executable program under src/phplint. Actually, running the ./compile script is the only thing required to build PHPLint under Unix/Linux. The other warning messages about the missing garbage collector library GC can be safely ignored.[more...]

2012-04-21 by Guest
PHPLint: unable to compile under Ubuntu 11.10 x86_64 and PHP 5.4
Hi, I really wanted to try PHPLint but I am having problems compiling it. Package: phplint-pure-c-1.1_20120402.tar.gz OS: Ubuntu 11.10 PHP version: 5.4 When I execute ./configure under the untarred directory from the tar.gz file above, and I get the following: ------- Guessing system type: Your system type is: LINUX Checking compiler: ...ok Checking alloca(): ...ok Checking vasprintf(): ...ok Checking Garbage Collector (GC) library: try.c:1:19: fatal error: gc/gc.h: No such file or directory compilation terminated. WARNING: gc.h or libcg.so missing or unexpected library path. The generated programs will consume more memory than necessary, but apart that they will work fine. If you decide to install the GC later, remember to re-run this configure script. There is no need to re-run 'make', but your program will need to be re-compiled in order to take advantage from the GC support. Guessing processor endianess: ...compiling endianess_guess.c ...detected byte ordering: 1234 Configuration f[...][more...]