For example, on my local test wiki:
$u = new User; $u->isAllowed("read"); var_dump($u);
This took 8m50s to complete, with stdout redirected to /dev/null. The problem appears to be that the growth of DI patterns, as opposed to class static members, means that everything links to everything and so dumping various kinds of object leads to dumping the whole address space. In this case, breaking in with gdb after a few seconds, the stack trace shows:
- Closure (LanguageConverterFactory::$defaultLanguage dumps its closure argument $services)
Another route to MediaWikiServices is via ObjectFactory.
I think the solution is to use __debugInfo() to break links from value-like objects to service-like objects, and links from service-like objects to the service container.