Currently MediaWiki provides a custom console via eval.php, which is integrated with the wiki's environment but otherwise rather poor (no proper readline support, no fatal error handling, the P part of REPL is missing, no tab autocompletion, no reflection...). Vagrant provides phpsh / hhvmsh which is somewhat better but still mediocre. It would be nice to replace these with a great REPL like [[ http://psysh.org/ | PsySH ]] or [[ https://changelog.com/meet-boris-a-tiny-repl-for-php/ | Boris ]].
Landed as `maintenance/shell.php`.
Things to maybe improve listed by @tgr:
* Unicode support (T69924 - seems to be a HHVM bug)
* get the dependencies to WMF production (https://gerrit.wikimedia.org/r/#/c/339584/)
* use personal readline configuration
* preserve readline history between sessions (per `Configuration::getReadline()` this should happen but does not)
* install the PHP docs (so that help and reflection in PsySH works)
* integrate with PSR-3 logging (add a flag to show what has been logged during a command)
* add [[http://php.net/manual/en/language.oop5.magic.php#object.debuginfo|`__debugInfo()`]] to MediaWiki classes (used by [[http://symfony.com/doc/current/components/var_dumper/advanced.html#casters|VarDumper]] which is used by PsySH)
* add a custom tab completion matcher, to support __get-based stuff. (Not sure if there is a good use case for that now. In the future, maybe services defined by extensions?)