Support » Plugin: Advanced Gutenberg Blocks » Not Working in PHP 5.6

  • Resolved Fencer04


    After updating to the latest version I’m getting the following error:

    Parse error: syntax error, unexpected '?' in /var/www/clients/devgiving/wp-content/plugins/advanced-gutenberg-blocks/classes/Blocks/Code.php on line 257

    I believe that you are using the ?? operator which is PHP 7 and above only. I’m running 5.6 and the repository doesn’t say that this is supposed to work for 5.6 and after.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thierry


    Just wondering why one would still use a deprecated version of PHP… WordPress themselves recommend using 7.3 or above.

    They state as follows:

    Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.6.20+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.

    Plugin Author maximebj


    As Thierry suggets, you should switch to PHP 7+ : there is no retrocompatibility issue to get to the newer version of PHP.

    There are a lot of performance improvments, and for developers new syntaxes that simplify coding.

    7.4 is new and stable. But if you wan’t to be sure, set 7.3

    Thread Starter Fencer04


    I have several issues with this response.

    1. The plugin still says it’s compatible with PHP “5.6 or higher”
    2. There is nothing in the change log that says that the compatibility has changed. This means that people will not know and their sites will be broken upon updating.
    3. You are also wrong in saying that there is no retrocompatibility issues. I have several things that will not run on the newer version of PHP. I’m not the person that makes these decisions so I can’t just universally update.

    I understand the points that are being made but there should have been notice given that the compatibility will change. I could have ignored the update and found a suitable replacement. As it stands now it is still incorrectly labeled in the plugin repository.



    That sounds very German: “If there is written compatible with PHP 5.6 it has also to be compatible with PHP 5.6!” (And now take your spiked helmet off) 🙂

    Not sure if this is the correct attitude… As a software developer myself, I neither care about backwards compatibility nor do I make a statement about that. To educate my clients, I sometimes even add specific code to prevent my software from running on outdated systems under WinXP or Win7.

    And so, I also think it is the duty of every website operator to constantly update and maintain their installation because using obsolete software like outdated PHP versions opens security holes and puts your server and all clients who visit your website potentially to danger.

    Thus, instead of pestering about an outdated compatibility information, be responsible and update your server, please!

    Plugin Author maximebj


    I’ll update the readme.txt to say that PHP 7.0 minimum is required. Thanks.

    I fully understand what you say Fencer, and I surely can change the few places where I use a PHP 7+ syntax.

    I’ve just spend 5h on this plugin because Gutenberg has changed for the 1000th time things that broke the plugin, because they don’t care anymore. This is frustrating indeed.

    So I’m trying to find where I used new syntaxes and write them in a retrocompatible way. I’m sure this can work well if I change a couple of things.
    I’ll ship a new version today, please try and tell me if you see other errors. I’l try to fix them

    • This reply was modified 2 years, 1 month ago by maximebj.
    Thread Starter Fencer04


    @maximebj It’s much appreciated. I completely understand the frustration. We are in the process of migrating to a newer server but this is on an intranet and not exposed to the outside world so it’s isn’t the highest priority to update the PHP versions on this server.

    I definitely understand the demands the changes in Gutenberg has created. I have a half dozen or so custom blocks written for the same site and even that small amount of items has been a pain to update as they change how everything works.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Not Working in PHP 5.6’ is closed to new replies.