• Resolved Oliver Campion

    (@domainsupport)


    Hi,

    We’re seeing a lot of these in the debug.log …

    [08-Feb-2023 11:15:20 UTC] E_NOTICE: String offset cast occurred in /wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php on line 1064

    Could you please investigate?

    Thank you,

    Oliver

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author launchinteractive

    (@launchinteractive)

    Hi Oliver,

    I’m not getting these errors with PHP 7.4 or 8.1

    What version of PHP are you using?

    Thread Starter Oliver Campion

    (@domainsupport)

    Hi,

    It’s PHP v7.4.32

    If you cast the string offset to an integer on line 1064 …

    return sprintf('%.' . $decimals . 'f', $bytes / pow(1024, $factor)) . @$sz[(int)$factor];

    … the PHP doesn’t generate a warning.

    The reason is that floor() returns an integer as a float and you require an integer to use as the string offset.

    Oliver

    Plugin Author launchinteractive

    (@launchinteractive)

    Thanks Oliver. I’ve pushed out an update to resolve this.

    Thread Starter Oliver Campion

    (@domainsupport)

    That’s great, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Error Notice – String offset cast occurred’ is closed to new replies.