Hello.
You can also use the global keyword for example like this in snippet:
global $variable = [
"opt1" => "/opt1",
"opt2" => "/opt2",
"opt3" => "/opt3",
];
and like this in plugin:
global $variable;
echo $variable;
But make sure that the snippet code is executed before the plugin...