- Issue created by @wildcats369
- @superman369 opened merge request.
- Status changed to Needs work
over 1 year ago 11:53pm 13 July 2023 - πΊπΈUnited States lemming
Hello @superman369 thanks for the bug report and the patch.
It would actually be better to avoid casting values, and instead update the conditional to check if the value is a string or not a string. Casting to a string has some hidden overhead here, and we can definitely avoid it.
I'd be okay with:
if ((is_int($key) || $key === '' || $key[0] !== '#') && is_array($child))
Or
if ((!is_string($key) || $key === '' || $key[0] !== '#') && is_array($child))
The latter might be better because it verifies that they key is associative (a string) before treating it as a string. The first option should also work because PHP only allows integers and strings as array keys.
- Status changed to Fixed
over 1 year ago 12:17pm 14 July 2023 - πΊπΈUnited States lemming
Thanks for the quick response and the updated PR.
I've merged this in, and have a release coming soon that will include this.
Automatically closed - issue fixed for 2 weeks with no activity.