gap buffer data structure in PHP programming language