I’m using the plug-in:
https://www.ads-software.com/plugins/php-compatibility-checker/
to do a preliminary check of my site for php 7 compatability.
The plugin throws the following complaints after running:
FILE: /plugins/youtube-showcase/includes/common-functions.php
————————————————————————————————–
FOUND 1 ERROR AFFECTING 1 LINE
————————————————————————————————–
138 | ERROR | Global with variable variables is not allowed since PHP 7.0
————————————————————————————————–
FILE: /plugins/youtube-showcase/includes/integration-shortcodes.php
——————————————————————————————————–
FOUND 1 ERROR AFFECTING 1 LINE
——————————————————————————————————–
28 | ERROR | Global with variable variables is not allowed since PHP 7.0
——————————————————————————————————–
FILE: /plugins/youtube-showcase/includes/shortcode-functions.php
—————————————————————————————————–
FOUND 6 ERRORS AFFECTING 6 LINES
—————————————————————————————————–
139 | ERROR | Global with variable variables is not allowed since PHP 7.0
167 | ERROR | Global with variable variables is not allowed since PHP 7.0
173 | ERROR | Global with variable variables is not allowed since PHP 7.0
176 | ERROR | Global with variable variables is not allowed since PHP 7.0
335 | ERROR | Global with variable variables is not allowed since PHP 7.0
403 | ERROR | Global with variable variables is not allowed since PHP 7.0
—————————————————————————————————–
On examining the code, the plug-in is correct. Here is the first example:
global $$glob_limit,$$glob_orderby;
From the php7.0 manual:
‘global only accepts simple variables
Variable variables can no longer be used with the global keyword. The curly brace syntax can be used to emulate the previous behaviour if required:
<?php
function f() {
// Valid in PHP 5 only.
global $$foo->bar;
// Valid in PHP 5 and 7.
global ${$foo->bar};
}
?>
As a general principle, using anything other than a bare variable with global is discouraged.’
Hopefully this provides you with al the info you need?
Many Thanks!
Chris