PHP was not working for me as I was encountering this libpng issue, so I reinstalled a new version with Homebrew.
However, I\'m getting a similar error with
As @lifecom notes, this is fixed with homebrew's php70 update, but you might still run into the problem if brew upgrade
is trying to update other packages before upgrading php70.
Fix this by manually updating php70 first with brew upgrade php70
and you then should be able to run brew upgrade
no problem (or, well, at least without this problem).