Your last snippet has a memory leak.
In reply to Re^3: Numeric sorting WITHOUT <=> by ikegami in thread Numeric sorting WITHOUT <=> by Anonymous Monk