Why might the PHP -l
switch not find errors in test.html
.
$ cat test.html
<?php
error_reporting(E_ALL);
echo "Hello, world!";
sdfsdfsdfsdf
?>
$ php -dhtml_errors=0 -ddisplay_errors=On -l test.html
No syntax errors detected in test.html
$ php test.html
Hello, world!PHP Notice: Use of undefined constant sdfsdfsdfsdf - assumed 'sdfsdfsdfsdf' in test.html on line 7
$
Other types of errors are also not found, such as undefined functions, require_once()
to nonexistant files, incorrect syntax in array declarations, etc. Why might this be?
Thanks.