Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know that you can run php -l filename.php to run a syntax check on a file, but is there a way of parsing the file without actually executing it (ie without running any of the in-built PHP functions) as a double-check against calling undefined functions for example?

This guy has the same question, except he wants things like print to still produce output which I'm not bothered about.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

How about using an IDE with a PHP plugin? That would allow you syntax highlighting and intellisense/code completetion, along with varying degrees of parse/checking. It looks like there are at least two for Eclipse: PHPEclipse and PHP Dev Tools - and one for visual studio: vs.php (paid).

share|improve this answer
    
Netbeans for PHP is actually also very good for this (no plugins required), I was just hoping for more of a command line/independent tool –  Jon Mar 1 '12 at 13:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.