Pick fix for #724 off unstable-3.0 onto master

See http://www.phing.info/trac/ticket/724