Laravel 5: tinker arrow keys problem

There could be a problem using ‘php artisan tinker’ on a linux machine. In the tinker/psy shell, pressing any of the arrow keys is printing character literals to the screen rather than performing the intended behaviour (move character for left and right, cycle recent commands for up and down). The cause is that PHP REPL does not implement readline’s line editing and history capabilities. Solution:

rlwrap php artisan tinker