I'm calling php lint from a Windows batch file, like so:
@echo off
for %%f in (*.php) do php -l %%f
When a file contains a syntax error, it only outputs Errors parsing xxx.php
. Is there any way to get it to tell me what the nature of the error is, and what line it's on? Maybe another switch?
If you get the "Errors parsing foo.php" message without any details, this parameter shows errors when you run PHP lint:
php -d display_errors=1 -l foo.php
Example:
[somewhere]# php -l submit.php Errors parsing submit.php [somewhere]# php -d display_errors=1 -l submit.php Parse error: syntax error, unexpected T_VARIABLE in submit.php on line 226 Errors parsing submit.php