Title: PHP7 Compatibility issue
Last modified: September 1, 2016

---

# PHP7 Compatibility issue

 *  Resolved [Aurélien Joahny](https://wordpress.org/support/users/ajoah/)
 * (@ajoah)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/)
 * Hi 🙂
 * Your plugin have a compatibility issue with last version of php.
 * You use dynamic variables names like this :
    `$$all_options['first_order']`
 * but it is ambigous like explained here : [http://php.net/manual/en/language.variables.variable.php](http://php.net/manual/en/language.variables.variable.php)
 * _In order to use variable variables with arrays, you have to resolve an ambiguity
   problem. That is, if you write $$a[1] then the parser needs to know if you meant
   to use $a[1] as a variable, or if you wanted $$a as the variable and then the[
   1] index from that variable. The syntax for resolving this ambiguity is: ${$a[
   1]} for the first case and ${$a}[1] for the second. _
 * Consequence : sitemap is not displayed and a lot of notices are displayed on 
   frontend and backend settings page.
 * The solution is to replace the code by :
 * `${$all_options['first_order']}`
 * [https://wordpress.org/plugins/wp-realtime-sitemap/](https://wordpress.org/plugins/wp-realtime-sitemap/)

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

 *  Thread Starter [Aurélien Joahny](https://wordpress.org/support/users/ajoah/)
 * (@ajoah)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-7682782)
 * I think this issue causes the problems listed here : [https://wordpress.org/support/topic/sitemap-does-not-work-any-more?replies=5](https://wordpress.org/support/topic/sitemap-does-not-work-any-more?replies=5)
 *  Plugin Author [Rincewind](https://wordpress.org/support/users/rincewind/)
 * (@rincewind)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-7682827)
 * I have no access at the moment to PHP 7, and so am unable to test, verify and/
   or fix any issues that may or may not work with that version. Until such time
   as I do it will stay as it is, if someone would like to fix the issues for the
   benefit of themselves and other users feel free, if they was to contact me via
   email with the code I would be happy to commit it to the svn and give them credit
   for the fixes.
 *  Thread Starter [Aurélien Joahny](https://wordpress.org/support/users/ajoah/)
 * (@ajoah)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-7682832)
 * Thank you for your answer. I understand. I hope that you’ll be able to test this
   great version soon :).
 *  [Thomas McMahon](https://wordpress.org/support/users/twistermc/)
 * (@twistermc)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-8735208)
 * Out of curiosity, could you use AMPPS or MAMP to spin up a PHP7 environment for
   testing?
 *  [axlright](https://wordpress.org/support/users/axlright/)
 * (@axlright)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-8862745)
 * Based on the feedback of [@ajoah](https://wordpress.org/support/users/ajoah/),
   this update to line 1774 technically makes the plugin work in PHP7 :
 * `return ${$all_options['first_order']} . ${$all_options['second_order']} . ${
   $all_options['third_order']} . ${$all_options['fourth_order']} . ${$all_options['
   fifth_order']} . ${$all_options['first_order']} . $all_options['seventh_order'].
   $promote;`
 * One non-fatal error still exists :
 * Methods with the same name as their class will not be constructors in a future
   version of PHP; WPRealtimeSitemap has a deprecated constructor in wp-realtime-
   sitemap/wp-realtime-sitemap.php on line 32
    -  This reply was modified 9 years, 2 months ago by [axlright](https://wordpress.org/support/users/axlright/).
    -  This reply was modified 9 years, 2 months ago by [axlright](https://wordpress.org/support/users/axlright/).
    -  This reply was modified 9 years, 2 months ago by [axlright](https://wordpress.org/support/users/axlright/).
      Reason: fix typos
    -  This reply was modified 9 years, 2 months ago by [axlright](https://wordpress.org/support/users/axlright/).
      Reason: fix typos
 *  [chrisplough](https://wordpress.org/support/users/chrisplough/)
 * (@chrisplough)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-9028099)
 * Likewise, I’m a user of WP Realtime Sitemap and am preparing for an upgrade to
   PHP7. I’d like to add my vote to an update that is compatible. Thanks in advance!
 *  Plugin Author [Rincewind](https://wordpress.org/support/users/rincewind/)
 * (@rincewind)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-9369540)
 * v1.5.7 now fully works with php 7.
 * You have [@gingalley](https://wordpress.org/support/users/gingalley/) for providing
   the php 7 hosting and also myself to thank for this!
 * If you would like to make a donation, you can do so here : [http://goo.gl/mmUuGj](http://goo.gl/mmUuGj)
 * This is entirely optional, but does mean that I am able to spend more time providing
   support and fixing issues than I would normally as working on this plugin doesn’t
   pay the bills.

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/wp-realtime-sitemap.svg)
 * [WP Realtime Sitemap](https://wordpress.org/plugins/wp-realtime-sitemap/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-realtime-sitemap/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-realtime-sitemap/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-realtime-sitemap/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-realtime-sitemap/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-realtime-sitemap/reviews/)

## Tags

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

 * 7 replies
 * 5 participants
 * Last reply from: [Rincewind](https://wordpress.org/support/users/rincewind/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/php7-compatibility-issue-1/#post-9369540)
 * Status: resolved