a few observations....
I use Cygwin PHP v7 and readline is available. The readline_list_history() function though is not defined.
A prompt with escape sequences are sanitized, so use something like:
<?php
echo("\e[0m\e[34mPromt>\e[0m");
$inp = readline(' ');
?>
I have not fully documented it, but I see that sometimes strings beginning with punctuation characters do not make it into the history with readline_add_history(). They also sometimes clear the prompt string.