If you manually call ob_start() at the beginning of your script, you might notice that you are unable to use phpsh. By commenting it out, I was able to fix the issue.

I don’t think it technically hangs, it just sits there with the data in a buffer waiting to be flushed.