views:

11

answers:

1

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

A: 

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.

Marc B
Thanks, it must have been my php.ini settings.
Tom