Small fixes (PR #3022)

- Fix incorrect variable in mb_strlen() compat
- Micro-optimization of array_replace(), array_replace_recursive() compat
2 files changed