[wp-trac] [WordPress Trac] #53282: "A non-numeric value encountered" warning when checking mbstring.func_overload
WordPress Trac
noreply at wordpress.org
Wed May 26 15:56:35 UTC 2021
#53282: "A non-numeric value encountered" warning when checking
mbstring.func_overload
----------------------------+-----------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8
Component: General | Version:
Severity: normal | Keywords: has-patch
Focuses: |
----------------------------+-----------------------
Reported by @djbu on [https://ru.wordpress.org/support/topic/a-non-
numeric-value-encountered-in-wp-includes-pomo-streams-php-on-line-21/
support forums].
If a web host has the `mbstring.func_overload` PHP value set to something
other than a numeric string, you'll see warnings like this in the error
log:
{{{
PHP Warning: A non-numeric value encountered in .../wp-
includes/functions.php on line 6746
PHP Warning: A non-numeric value encountered in .../wp-
includes/pomo/streams.php on line 21
}}}
This is obviously an edge case, but we can easily avoid the warning be
casting the value to `(int)` before checking.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53282>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list