Title: PHP 8 Support
Last modified: April 1, 2021

---

# PHP 8 Support

 *  Resolved [kreekhoorn](https://wordpress.org/support/users/kreekhoorn/)
 * (@kreekhoorn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/)
 * Hi,
 * Thank you very much for this great plugin! I recently updated a website to PHP
   8, however then a Fatal Error occurs from this plugin. Could you check this out?
   I will try to post the error, and maybe a possible solution later today/tommorrow.
 * Kind regards,
    Kenneth
    -  This topic was modified 5 years, 2 months ago by [kreekhoorn](https://wordpress.org/support/users/kreekhoorn/).

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

 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14265474)
 * I’m looking into this right now. My upgrade to PHP 8.0.3 failed, so I’ll need
   to fix that first.
 * Meanwhile, do you know the nature of the fatal error, and which module it failed
   in?
 *  Thread Starter [kreekhoorn](https://wordpress.org/support/users/kreekhoorn/)
 * (@kreekhoorn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14265969)
 * Thanks for you quick reply! I think I’ve found the issue and a solution.
 * In /src/utility/general.php on line 176 the check is not correct anymore. This
   results in an empty string passed to the abs() function later on, which results
   in a fatal error.
 * To fix line 176 should be replaced with:
    `if ( ! empty( $markup ) )`
 * The error that was raised was
    [Thu Apr 01 20:02:56.074345 2021] [proxy_fcgi:
   error] [pid 11484:tid 139834597304064] [client 127.0.0.1:56662] AH01071: Got 
   error ‘PHP message: PHP Fatal error: Uncaught TypeError: abs(): Argument #1 (
   $num) must be of type int|float, string given in {domainroot}/wp-content/plugins/
   markup-by-attribute-for-woocommerce/src/utility/general.php:165
 * If you need any more info, let me know.
    Kenneth
 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14266033)
 * I found the same thing! Essentially, !empty and <>0 are no longer the same in
   PHP 8.
 * There are similar IF’s throughout the code, resulting in some other anomalies–
   such as updating the variation descriptions when there is no markup. Even when
   it does not present an obvious problem, I still want to correct the code.
 * So, I’ve done that. I need to run through regression testing and update the version
   numbers before I can publish the new version. Be expecting it later today.
 *  Thread Starter [kreekhoorn](https://wordpress.org/support/users/kreekhoorn/)
 * (@kreekhoorn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14266066)
 * Great! Good to hear. Thanks for your awesome (quick) work on this plugin and 
   thanks for your quick reply!
 * If I can help you with anything, let me know.
 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14266541)
 * The updated version is now available, and should appear as such on your WordPress
   plugins page. It resolves the issue throughout the code. Thank you for brining
   it to my attention.
 * During regression testing I noticed a little unrelated glitch when markup rounding
   is used and the markup rounds to zero. Not a big deal and I don’t think anyone
   will notice except me. But, I will be correcting that as well, so don’t be surprised
   if I release another version in the next couple of days.

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

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

 * ![](https://ps.w.org/markup-by-attribute-for-woocommerce/assets/icon-256x256.
   png?rev=2952499)
 * [Markup by Attribute for WooCommerce](https://wordpress.org/plugins/markup-by-attribute-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/markup-by-attribute-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-support-5/#post-14266541)
 * Status: resolved