#10357 closed enhancement (invalid)
Use strtr() when possible
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Optimization | Version: | |
| Severity: | normal | Keywords: | has-patch close |
| Cc: |
Description
When replacing strings of the same lenght, it's better to use strtr() instead of str_replace() because it's faster.
Attachments (1)
Change History (6)
There are conflicting reports on which is faster, seems strtr() is a little faster only for very short strings but the difference is less than a microsecond.
- Component changed from General to Optimization
- Milestone changed from 2.8.2 to 2.9
- Resolution set to invalid
- Status changed from new to closed
I guess it's not worth the trouble.
Note: See
TracTickets for help on using
tickets.

use strtr() for single character replacements