Heyo
I'm currently working at a broken theme that someone else authored for WordPress. Upon a fresh install it throws a 500 error. After inspecting the code on my local machine, I'm able to lint the following:
public static function skip_script($conf) {
$hook_suffix = isset($GLOBALS['hook_suffix']) ? $GLOBALS['hook_suffix'] : null;
if (isset($conf['variable'])) {
global $$conf['variable'];
}
$conditions = array(
'variable' => isset($conf['variable']) && (!isset($$conf['variable']) || !$$conf['variable']),
'hook_suffix' => isset($conf['hook_suffix']) && (is_null($hook_suffix) || $conf['hook_suffix'] != $hook_suffix)
);
return in_array(true, array_values($conditions), true);
}
The linter is upset with this:
if (isset($conf['variable'])) {
global $$conf['variable']; # What the heck is this?
}
I can check the PHP error log and reproduce the same error on the server:
PHP Parse error: syntax error, unexpected '[', expecting ',' or ';'
This WordPress theme is known to work in the past but appears to have been abandoned over the last 3 years.
Let me get to the heart of the question: What the heck is global $$conf['variable']; supposed to do. I'm assuming this is deprecated code, because it had worked before.