PHP 警告:遇到非数字值需要修复

PHP Warning: A non-numeric value encountered need fix

我在执行创建订单操作时遇到此错误 PHP 警告:第 257 行 /home/elazbagr/mysite/wp-content/plugins/custom-point/custom_point.php 中遇到非数值

第257行是

            $diff = $duration - $stored_date;

这条上下线

            $duration = get_option("wc_settings_tab_period_of_changes",true);
            //$today_date = date("Y/m/d");
            $diff = $duration - $stored_date;
            //$diff = abs(round($diff / 86400));
            if($duration == 0) {

请帮我解决这个问题 问候

什么值有变量 $stored_date,

如php所说A non-numeric value

像这样试试:

$diff = (int)$duration - (int)$stored_date;