Circular Buffer on PHP