sys-libs/db-4.7 is the stable release but dev-lang/php-5.2.11 has a hardcoded link to 4.6 or earlier. Reproducible: Always Both are the current stable version, patch to add support included below
Created attachment 207529 [details, diff] patch to add support for sys-libs/db-4.7
Thanks for the patch! Digging into this, the issue seems to be resolved upstream meanwhile: http://www.mail-archive.com/php-cvs@lists.php.net/msg45879.html So building against sys-libs/db-4.{7,8} will be available in php-5.2.14 and php-5.3.3. We should be aware of http://bugs.php.net/bug.php?id=51086, though. We will discuss applying this patch to our soon to be version of php-5.3.2, anyway.
A patch is part of the current patchset for php-5.3.2, you should be able to use any db-4* version you like. Be aware that the problem mentioned above is fixed in db-4.8.30 - so if you plan to use 4.8.* please use this version. I'm not enforcing this in the ebuild as db should have that version stable before we have php-5.3.2 ready.