Global for sure.
You are going to pollute your code with useless extra parameter just for nothing.
Look, most people just learn some rules by heart, and follow them unconditionally. But it is better to understand their meaning and use wisely, depends on the context.
There is nothing wrong in calling a cat a cat. Yet nothing wrong in calling global variable a global.
Although "globals are generally considered a bad practice", this case is different.
It is indeed a bad practice when you're using global
keyword to pass local variables. It makes your code obscure and hard to support - I am not arguing that.
But a true global variable is a completely different matter. PHP is using them all the way - a $_SERVER
array is a perfect example.
So, for a really global variable, which is used all the way throughout your code and being the part of documented API - global
is the best choice.