Get list of preprocess block variables
echo &quot;&lt;pre&gt;&quot;; print_r($variables); echo &quot;&lt;/pre&gt;&quot;;

That's not how it should be done, instead, install the Devel module.
This will allow you to do:
dump($variables);

If you haven't turned caching off, for developing purposes, then you will have to flush all caches to see the dump.

In addition, if you also install the kint package/library with:
composer require kint-php/kint

now you could also do:
kint($variables);

Related: Welcome to Kint 101