With a -- :

for i in `dpkg -L php5-dev`; do egrep -- "--with" $i; done