Title: PHP 7.1 error in basic-functions.php
Last modified: April 6, 2017

---

# PHP 7.1 error in basic-functions.php

 *  [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/)
 * With PHP 7.1 this error shows intermittently:
 * `[06-Apr-2017 18:35:29 UTC] PHP Warning: A non-numeric value encountered in /.../
   wp-content/themes/evolve/library/functions/basic-functions.php on line 1430`
 * This seems to relate to this line of code:
 * `echo ' col-md-4 odd' . ( $xyz % 3 );`
 * Which is part of this sequence:
 *     ```
       function evolve_post_class($xyz) {
   
               $evolve_post_layout = evolve_get_option('evl_post_layout', 'two');
   
               if ($evolve_post_layout == "two") {
                   echo ' col-md-6 odd' . ( $xyz % 2 );
               } else {
                   echo ' col-md-4 odd' . ( $xyz % 3 );
               }
       ```
   
 * Please see [http://php.net/manual/en/migration71.other-changes.php](http://php.net/manual/en/migration71.other-changes.php)
   for reasons for this error.
 * This is same error as I previously reported here – [https://wordpress.org/support/topic/php-error-in-logs/](https://wordpress.org/support/topic/php-error-in-logs/)–
   since that time upgrades to the theme have been released, but this has not yet
   been corrected.

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

 *  [donnaWPadmin](https://wordpress.org/support/users/donnawpadmin/)
 * (@donnawpadmin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9003524)
 * Well, % is a modulus operator, but $xyz is a class name…so I’m not sure why the
   modulus operator is there, that wants a math function…try removing it (the %2
   or %3)
 * is something broken in theme, or is it just a warning…be careful changing stuff
   if everything works good…you can turn off debug and you won’t see them. [https://codex.wordpress.org/WP_DEBUG](https://codex.wordpress.org/WP_DEBUG)
 *  [donnaWPadmin](https://wordpress.org/support/users/donnawpadmin/)
 * (@donnawpadmin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9003526)
 * or are you just reporting a bug? If that’s the case, ignore my post…(but they
   should have another place for that really I think)
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9004204)
 * Debugging is not enabled my WP installation – this is showing up in the error_log—
   not impairing site function.
 * However, this is an issue that should be addressed. PHP 7.1 was released in December
   2016. I’m running more than a dozen WP sites with different plugin and themes,
   and I tested them all with PHP 7.1 in February and reported errors then.
 * Evolve is the only theme remaining (among the ones I use) that has not yet addressed
   this issue.
 * The bottom line is that the code does not validate under current (latest) standards,
   because of changes introduced in PHP. It’s not the fault of the developer that
   changes to PHP weren’t anticipated when the file was coded, but it is important
   to maintain compatibility down the line — so that is why I am reporting it.
 * Thank you for the suggestion about removing the modulus operator. I’m reluctant
   to make changes to a theme lest I introduce other errors, but I’ll test to see
   if that seem to resolve the problem and post back here if it does.
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9005070)
 * Donna, thank you for your suggestion — I did change line 1430 from:
    `echo ' 
   col-md-4 odd' . ( $xyz % 3 );` to `echo ' col-md-4 odd' . ( $xyz );`
 * And I haven’t seen any more entries in my error log since making the change.
 * I’m not sure what that bit of code was intended to do, but everything on my site
   appears to be functioning and displaying properly.
 * I did intend this post to be a bug report (or at least a possible compatibility
   issue with PHP 7.1) — so I’m leaving this marked as “not resolved” — the developer
   can review this and determine whether or not it is something that should be addressed.(
   My problem is that I assume that anything placed in code was intentional and 
   placed for a reason, so just because it works for me to delete a few characters
   doesn’t really mean that the problem has been addressed.)
 * But I definitely do appreciate your input — as it saves me the trouble of having
   to revert the site back to PHP 7.0.
 *  [donnaWPadmin](https://wordpress.org/support/users/donnawpadmin/)
 * (@donnawpadmin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9006844)
 * Sure, I understand.
 * The reason it works is because of how a modulus operator works. A modulus operator
   says “take a number, divide by another number, and whatever the remainder is,
   this is your answer”
 * For example : 7 modulus 3 is 1. Because 7 divided 3 is 2 with a remainder of 
   1. This is how the modulus operator works. In your code $xyx is a string or character
   variable, not a number. ( I don’t remember now, doing post from my phone)
 * Hopefully that explains why.
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9008565)
 * Thank you for your very clear explanation — I also appreciate the mini-lesson
   ion coding. I’m still puzzled by why it was coded that way in the first place.
 * The file is commented:
 *     ```
        /*
            * function to print out css class according to layout
            * used in content-blog.php, index.php.
       ```
   
 * so I am guessing that the goal is simply to generate a stylesheet which adapts
   to values users have entered in theme customizations… and apparently it isn’t
   working anyway. At least for me I haven’t noticed any issues with layout after
   modifying the script, but if it did crop up I have a child theme and could correct
   any issues by manually editing my child stylesheet.
 * So I’ll let the developers figure out the rest.
 *  [donnaWPadmin](https://wordpress.org/support/users/donnawpadmin/)
 * (@donnawpadmin)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9008593)
 * It looks like it has something to do with columns…
    -  This reply was modified 9 years, 2 months ago by [donnaWPadmin](https://wordpress.org/support/users/donnawpadmin/).
 *  [Romik84](https://wordpress.org/support/users/romik84/)
 * (@romik84)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9009259)
 * Hello
 * This issue solve in next theme update, In many files this change required.
    Only
   issue generate with 7.1.X version now.
 * Thank you

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

The topic ‘PHP 7.1 error in basic-functions.php’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/evolve/4.3.7/screenshot.png)
 * evolve
 * [Support Threads](https://wordpress.org/support/theme/evolve/)
 * [Active Topics](https://wordpress.org/support/theme/evolve/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/evolve/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/evolve/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Romik84](https://wordpress.org/support/users/romik84/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-1-error-in-basic-functions-php/#post-9009259)
 * Status: not resolved