How do I get the line and error type when performing a php lint check?
When I开发者_开发技巧 run $ php -l /path/to/script.php it will report whether an error occurs or not, but won't indicate the line or error type when an error does occur. Is there a better command line tool for lint checking or another way to get more error information?
Thanks
Odd, php -l
reports errors just fine for me. test.php test script:
<?php
random_function_name('blah);
^--- missing closing quote
gives me:
marc@panic:~/z$ php -l test.php
PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ')' in test.php on line 2
Errors parsing test.php
marc@panic:~/z$
Check your error_reporting
and display_errors
settings and make sure that errors aren't being supressed.
精彩评论