In order to test my PHP projects on errors I normally use this command:
find ./ -type f -name \*.php -exec php -l '{}' \; | grep -v "No syntax errors detected"
I would like to extend the part php -l '{}' \;
with some parameters so it will use a custom error_reporting level and not the one defined in php.ini. Is this possible?
(I know that the question is somewhat coding related. On the other side it is more about shell commands. If you think it should be better on stackoverflow then feel free to move it. I was not sure where the question fits better.)
According to
php -h
If you want the recommended production default (
E_ALL & ~E_DEPRECATED
), the value would be22527
in PHP 5.3, and24575
in PHP 5.4+.Finding the value for various combinations is simple.