This is a reminder that php -a will hang (well, it did for me) when you don't have readline enabled (USE="-readline"). It'd be nice if php would output a notice or refuse to run altogether under this circumstances. For a fast alternative, I'm considering adding a use-conditional note to pkg_postinst to inform the user about this.
Added the note in the overlay, which will shortly sync with portage.