I tried some of times to make success to compile all versions of dev-lang/php, with searching the solution to solve "Compilation fail" issue, and changing version of sys-devel/libtool. There doesn't seem to be a clean solution from the forum (but there are some of useful hints), so I concluded that sys-devel/libtool version 2.4.2 or later causes too many problem(for php and the other package which needs C++ core library).
Can you please post your `emerge --info` and provide the build logs?
1) Please post your `emerge --info' output in a comment. 2) Please attach the entire build log to this bug report.