Warning: A non-numeric value encountered

后端 未结 18 1833
抹茶落季
抹茶落季 2020-11-22 06:15

Recently updated to PHP 7.1 and start getting following error

Warning: A non-numeric value encountered in on line 29

Here is wha

18条回答
  •  长发绾君心
    2020-11-22 06:31

    Check if you're not incrementing with some variable that its value is an empty string like ''.

    Example:

    $total = '';
    $integers = range(1, 5);
    
    foreach($integers as $integer) {
        $total += $integer;
    }
    

提交回复
热议问题