U() return different things

If I write this in the config.php:

echo u();

I get this


If I write it in a plugin file I get this:


The last one is correct. Can you confirm that you get the same thing on a localhost environment? What’s the reason for this behaviour? Is it a bug?