PHP's proc_open() rewinds a redirected stdout file when you pass STDOUT or STDERR as a descriptor. A short repro, the one-line fix and a test that catches it.
When spawning a high-output CLI in Node.js, the last few KB vanish on process.exit(). After comparing 6 solutions, the only reliable cross-platform stdlib fix is piping the child stdout fd to a file.