• Resolved renrutsirhc

    (@renrutsirhc)


    Hi there,

    What’s the time frame for this plugin supporting php7? At the moment I’m getting the following error a number of times when I run a compatibility checker.

    138 | ERROR | Global with variable variables is not allowed since PHP 7.0

    Thanks
    Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author emarket-design

    (@emarket-design)

    I could not replicate any issue running the following:

    PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )

    If you provide more details, I will check.

    Thread Starter renrutsirhc

    (@renrutsirhc)

    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

    Plugin Contributor Safiye Duman

    (@safiye)

    Hi Chris,
    We just released a new version 2.6.0 which fixes these warnings and passes the php-compatibility-checker plugin. Thanks for reporting!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘php7 support’ is closed to new replies.