Title: PHP7 Compatibility Issues
Last modified: October 29, 2017

---

# PHP7 Compatibility Issues

 *  Resolved [b2bcherry](https://wordpress.org/support/users/b2bcherry/)
 * (@b2bcherry)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php7-compatibility-issues-2/)
 * Hi,
 * I am working on the migration of my website to php 7. In order to analyse my 
   site, I ran a test on all plugins and themes installed using “PHP Compatibility
   Checker” plugin.
    The test revealed a few of issues with WP Super Cache that 
   I wanted to share with you. This is the report on your plugin :
 * FILE: /…/wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-update-
   settings.php
    ———————————————————————————————————————– FOUND 1 ERROR AFFECTING
   1 LINE ———————————————————————————————————————– 652 | ERROR | Global with variable
   variables is not allowed since PHP 7.0 ———————————————————————————————————————–
 * FILE: /…/wp-content/plugins/wp-super-cache/wp-cache.php
    ——————————————————————————————————
   FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 4 LINES ——————————————————————————————————
   235 | WARNING | INI directive ‘safe_mode’ is deprecated since PHP 5.3 and removed
   since PHP 5.4 235 | WARNING | INI directive ‘safe_mode’ is deprecated since PHP
   5.3 and removed since PHP 5.4 240 | WARNING | INI directive ‘safe_mode_gid’ is
   deprecated since PHP 5.3 and removed since PHP 5.4 4008 | ERROR | Global with
   variable variables is not allowed since PHP 7.0 4025 | ERROR | Global with variable
   variables is not allowed since PHP 7.0 ——————————————————————————————————
 * Do you think your can update the code in the next version ?
 * Thank you,
 * Valéry

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php7-compatibility-issues-2/#post-9632976)
 * Hi [@b2bcherry](https://wordpress.org/support/users/b2bcherry/),
 * There are many similar posts where you can find more info. These _“ERRORS”_ aren’t
   fatal errors, so WPSC works on PHP 7.0. Anyway PR [#429](https://github.com/Automattic/wp-super-cache/pull/429)
   fixes them and it’s part of [Pre-1.5.8 Development Version](https://wordpress.org/support/topic/pre-1-5-8-development-version/).
   Version 1.5.8 will be released in next days.
 * Related to WARNINGS – `INI directive ‘safe_mode’ is deprecated since PHP 5.3 
   and removed since PHP 5.4`, we need to keep this code for backward compatibility
   with PHP 5.2. You can see these lines (wp-cache.php):
 *     ```
       if ( version_compare( PHP_VERSION, '5.3.0', '<' ) && ( 1 == ini_get( 'safe_mode' ) || "on" == strtolower( ini_get( 'safe_mode' ) ) ) ) {
           echo '<div class="notice notice-error"><h3>' . __( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ) . '</h3><p>' .
               __( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' ) . '<br />';
   
           if( !ini_get( 'safe_mode_gid' ) ) {
       ```
   
 * This code works only when PHP_VERSION is 5.2.x. PHP compatibility checker is 
   static checker and current version doesn’t check usage of `PHP_VERSION` in conditions.
   Related issue – [https://github.com/wpengine/phpcompat/issues/161](https://github.com/wpengine/phpcompat/issues/161).
 * I hope that helps.
 * Regards,
    Sasa
 *  Thread Starter [b2bcherry](https://wordpress.org/support/users/b2bcherry/)
 * (@b2bcherry)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php7-compatibility-issues-2/#post-9634820)
 * Thank you for this explanation Sasa

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP7 Compatibility Issues’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [compatibility](https://wordpress.org/support/topic-tag/compatibility/)
 * [PHP7](https://wordpress.org/support/topic-tag/php7/)

 * 2 replies
 * 2 participants
 * Last reply from: [b2bcherry](https://wordpress.org/support/users/b2bcherry/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/php7-compatibility-issues-2/#post-9634820)
 * Status: resolved