I am using a testing library and while trying to load Craft through bootstrap with:
$craft = require '<full path here to>/app/bootstrap.php';
(but with the real path)
I dumped the error to a html file from the console and get this:
I see that Ben Parizek got a similar error (but i don't believe it was while using bootstrap only from the command line) in this question.
I tried setting cache to file in general.php and also cleared all caches in craft.