This function is typically over a 1000 times slower on the first run in a php session compared to subsequent runs, and that is using a newly created formatter each time.
Timings for the first run have been from 60ms to 195ms, whereas subsequent runs are well under 100us.
For comparison, creating the formatter takes about 100us.