Title: PHP 7 Support
Last modified: September 1, 2016

---

# PHP 7 Support

 *  Resolved [neilmahaseth](https://wordpress.org/support/users/neilmahaseth/)
 * (@neilmahaseth)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-7-support-9/)
 * The plugin works if I use the shortcode but when I use this code
 *     ```
       <?php/*
       Template Name: Custom Redirect
       */ 
   
       $userInfo = geoip_detect2_get_info_from_current_ip();
       var_dump(get_object_vars($userInfo));
       if ($userInfo->country->isoCode == 'de')
        echo 'Hallo! Schön dass Sie hier sind!';
       endif;
       ```
   
 * in my php template file I receive the following output
 * country->isoCode == ‘de’) echo ‘Hallo! Schön dass Sie hier sind!’; endif;
 * Apparently the php tag is getting closed after parsing “->”. Also no output of
   the variable dump any idea what could be wrong. I am using PHP 7 and nginx server.
   I suspect that could be the problem but then the shortcode works fine. Any help
   appreciated thanks
 * [https://wordpress.org/plugins/geoip-detect/](https://wordpress.org/plugins/geoip-detect/)

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

 *  Thread Starter [neilmahaseth](https://wordpress.org/support/users/neilmahaseth/)
 * (@neilmahaseth)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-7-support-9/#post-7588632)
 * Solved the problem. It was because of a syntax problem. This
 *     ```
       <?php/*
       Template Name: Custom Redirect
       */
       ```
   
 *  should have been written as
 *     ```
       <?php
       /*
       Template Name: Custom Redirect
       */
       ```
   
 * Strange php didn’t show any errors for that.
    also only writing `var_dump(userInfo);`
   worked Thanks for this plugin. Hope this help others, facing similar problem.
 *  Thread Starter [neilmahaseth](https://wordpress.org/support/users/neilmahaseth/)
 * (@neilmahaseth)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-7-support-9/#post-7588634)
 * Forgot to mark as resolved.

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

The topic ‘PHP 7 Support’ is closed to new replies.

 * ![](https://ps.w.org/geoip-detect/assets/icon-256x256.jpg?rev=978998)
 * [Geolocation IP Detection](https://wordpress.org/plugins/geoip-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geoip-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geoip-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/geoip-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geoip-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geoip-detect/reviews/)

## Tags

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

 * 2 replies
 * 1 participant
 * Last reply from: [neilmahaseth](https://wordpress.org/support/users/neilmahaseth/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/php-7-support-9/#post-7588634)
 * Status: resolved