The PsySH shell built into MediaWiki (shell.php) is a great debugging tool but its typeahead functionality is limited. This is partially a (probably hard) upstream issue around how tab completion is handled, where AIUI readline offers limited flexibility, and partially unsolvable (since it has no way of knowing about classes or namespaces which haven't been autoloaded yet). With things increasingly getting namespaced and global functions deprecated, this means that using PsySH involves lots of tedious typing. We should improve that.
Probably the simplest option is to provide a debug helper class with a short name (Dbg or maybe just D) with a bunch of static methods for common commands, like D::services() to get the service container or D::u('someName') to get a user, and autoload the class when PsySH is fired up.