I build php 5.4.13 and re-ran the test. Same result: open FD's accumulate.

[2013-04-04 20:56 UTC] davek at gamehouse dot com

-PHP Version: 5.3.23+PHP Version: 5.4.13

[2013-04-04 20:56 UTC] davek at gamehouse dot com

Resolved:
Worked with our hosting company, joyent, on this. It was pointed out that they had
solved this issue about two years ago (https://bugs.php.net/bug.php?id=47675). I had
found that bug report before creating this one as I saw that the code change had been
added. However...
I didn't see this at first but looking more closely, when I look at my version of
main.c, old_cwd_fd is declared without the 'volatile' modifier. After reading up on
setjmp/longjmp and the use of volatile, I added it in, re-compiled and the issue is
resolved. It's clear in bug 47675 that the volatile modifier is there however it's
not been added into the code repository. Will this be added?