Based on the final requirement you don't need cd
; you can do the following:
find . -type d -name 'foo-*' -exec make -C {} ';'
and
find . -type d -name 'foo-*' -exec phing -f {}/build.xml ';'
The asterisks are handled by find
internally, and I believe this is POSIX compatible.