[wp-trac] [WordPress Trac] #56808: adding null coalescing operator for rtrim function to avoid deprecation
WordPress Trac
noreply at wordpress.org
Sun Jan 19 08:33:11 UTC 2025
#56808: adding null coalescing operator for rtrim function to avoid deprecation
-------------------------+------------------------
Reporter: asifmuztaba | Owner: (none)
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: General | Version:
Severity: normal | Resolution: duplicate
Keywords: | Focuses:
-------------------------+------------------------
Comment (by jusni5):
The warning you're encountering is due to a change in PHP 8.1, where
passing null to the first parameter of the rtrim() function is deprecated.
The proposed fix using the null coalescing operator (??) is correct and
ensures that the function behaves as expected without triggering the
deprecation warning.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56808#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list