Fatal error on PHP 8+ “Unsupported operand types: int + string”
-
Hi,
I’m getting a fatal error on my site (hosted on Cloudways) coming from this plugin:
PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /wp-content/plugins/woo-ultimate-order-combination/inc/functions.php:666This looks like a PHP 8+ compatibility issue: the code at line 666 is adding an integer and a string with the
+operator, and one of the values is apparently not numeric (e.g. an empty string ornull). On PHP 7.x this would just throw a warning and treat the string as0, but on PHP 8+ it’s a fatalTypeError.Could you take a look at line 666 of
inc/functions.phpand add a proper type cast ((int)/(float)) or anis_numeric()check before the addition?Environment:
- WordPress + WooCommerce (Cloudways hosting)
- PHP version: 8.3
- Plugin version: 2.0.6
Happy to provide more details (full stack trace, steps to reproduce) if needed.
Thanks!
You must be logged in to reply to this topic.