Reading the code I think the return value should be type casted to sting also for the is_int($text) case a bit above the is_float($text) modified here. (There is no PHP 8.1 error at that place but it would be right due to the function documentation).
But that would change behaviour regarding the return value's type in that case, and so I think this should be done with a future clean-up, together with type-hinting the methods.
Pull Request for Issue #
Summary of Changes
Analogue to PR https://github.com/joomla/joomla-cms/pull/36787 for the 3.10-dev branch of the CMS.
Testing Instructions
A code review could be sufficient. Otherwise see https://github.com/joomla/joomla-cms/pull/36787 .
Additional comments
Reading the code I think the return value should be type casted to sting also for the
is_int($text)
case a bit above theis_float($text)
modified here. (There is no PHP 8.1 error at that place but it would be right due to the function documentation).But that would change behaviour regarding the return value's type in that case, and so I think this should be done with a future clean-up, together with type-hinting the methods.
Documentation Changes Required
None.