Aug
25
Sublime Text : check PHP syntax on build
August 25, 2013 | Leave a Comment
In Sublime Text, go to Preferences -> Browse packages.
Go to the PHP folder and create an empty file PHP.sublime-build.
Edit this file and enter :
1 2 3 4 5 | { "cmd": ["php", "-l", "$file"], "selector": "source.php", "file_regex": "^Parse error: .* in (.*?) on line ([0-9]*)" } |
Now, when editing a .php file, press Cmd+B to run php-l on your file and check for syntax error
Filed under: Mac OS X
Tagged with: build, PHP, sublime text, syntax check
Liked this page?
Tweet it
Tweet
Subscribe to the RSS feed or sign up for the newsletter now.