Making php more efficient with splfixed array + minor changes