Title: PHP 7.2 compat
Last modified: December 23, 2017

---

# PHP 7.2 compat

 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compat/)
 * Hi.
    error logs are full of this:
 *     ```
       PHP message: PHP Warning:  A non-numeric value encountered in /wp-content/plugins/vkontakte-api/includes/comments.php on line 989
       PHP message: PHP Warning:  A non-numeric value encountered in /wp-content/plugins/vkontakte-api/includes/comments.php on line 1120
       ```
   
 * get_postmeta() can return empty string or false in case there is no meta field,
   
   it needs to be checked
 * something like this will suffice:
 *     ```
       <------>public function add_tabs_button_wp() {
       <------><------>global $post;
       <------><------>$vkapi_comm = get_post_meta( $post->ID, 'vkapi_comm', true );
       <------><------>$fbapi_comm = get_post_meta( $post->ID, 'fbapi_comm', true );
       <------><------>if ($fbapi_comm != '' && $fbapi_comm != false) $fappi = (int)($fbapi_comm);
       <------><------>if ($vkapi_comm != '' && $vkapi_comm != false) $vappi = (int)($vkapi_comm);
       <------><------>$comm_wp    = get_comments_number() - $vappi - $fappi;
       <------><------>$text       = __( 'Site', 'vkapi' );
       <------><------>echo "<div>
       <------><------><------>    <button style='white-space:nowrap'
       <------><------><------>            class='submit'
       <------><------><------>            onclick='showWP()'>
       <------><------><------>        {$text} ({$comm_wp})
       <------><------><------>    </button>
       <------><------><------></div>";
       <------>}
       ```
   
 * likewise for _public function do\_non\_empty()_

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

 *  [AiratTop](https://wordpress.org/support/users/airathalitov/)
 * (@airathalitov)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-2-compat/#post-9856855)
 * The same problem.
 * Log:
 * `PHP Warning: A non-numeric value encountered in /mypath/wp-content/plugins/vkontakte-
   api/includes/comments.php on line 1119`
 * Will you update and support your plugin?
 * VKontakte API 3.32.5.9
    WordPress 4.9.1 PHP 7.1.12-3+ubuntu16.04.1+deb.sury.org
   +1
    -  This reply was modified 8 years, 4 months ago by [AiratTop](https://wordpress.org/support/users/airathalitov/).
 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-2-compat/#post-9857662)
 * I think my “code fixes” cause performance slowdown, they silence the warnings
   of course

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

The topic ‘PHP 7.2 compat’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/vkontakte-api_f9f9f9.svg)
 * [VKontakte API - crossposting, comments, social buttons, login](https://wordpress.org/plugins/vkontakte-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/vkontakte-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/vkontakte-api/)
 * [Active Topics](https://wordpress.org/support/plugin/vkontakte-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/vkontakte-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/vkontakte-api/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Yui](https://wordpress.org/support/users/fierevere/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/php-7-2-compat/#post-9857662)
 * Status: not resolved