• Resolved Brian P

    (@bburgay)


    Hi,

    With PHP7 there is a non-numeric value encountered warning filling up the logs:

    A non-numeric value encountered in /plugins/ultimate-reviews/Functions/EWD_URP_Submit_Review.php on line 125

    This doesn’t break anything but it’s a bit annoying to have the logs polluted with this warning. I’d like to suggest initializing $Overall_Score to 0 (instead of an empty string) on line 118 and using intval on line 125:

    
    $Overall_Score += intval($Value);
    

    Thanks,
    Brian

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Hi Brian,

    Thanks for letting us know about this. I’m not sure if setting the overall score to 0 is the best way to get rid of the notices, but we’ll definitely make a note of this and look into the best way of removing them.

    Thread Starter Brian P

    (@bburgay)

    Hi,

    I am not saying set the overall score to 0. I am saying initialize it to 0. This means set it to 0 to begin with (so the type is int) instead of setting it to an empty string like you are now.

    Line 118:
    $Overall_Score = ”; —-> $Overall_Score = 0;

    I don’t know what your other use cases are for different rating types, but if it’s always calculated as a number just change the type to an integer.

    Best,
    Brian

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Hi Brian,

    Thanks for clarifying.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Non-numeric Value Encountered’ is closed to new replies.