What's the alternative for my failing PHP code about block visibility based on user?
You could perhaps just set the "Roles" options under the block visibility settings.

Alternatively, something like:

global $user;
return in_array('administrator', $user-&gt;roles) ? FALSE : TRUE;