#!/bin/sh
# Check for syntax errors in every PHP file under the current directory.

tmp=`mktemp`

for f in `find . -name '*.php'`; do
	TERM=dumb php -l $f </dev/null >$tmp 2>&1 || cat $tmp
done | sed '/^Errors parsing /d;/^$/d;s/ on line /:/g' >&2

rm -f $tmp
