A Vector is an object with keys and values. The keys are integers starting from zero. Like in Java and C# you may access each element in the array on O(1) (constant time). You may also insert elements in the end of the vector at O(1).

When working with Vectors you may use the square bracket syntax or the get/set functions. The square bracket syntax is preferable because it is faster and they are familiar to PHP developers.

When you are removing an element from a vector it will update the keys. So a Vector with 5 elements does always have keys 0, 1 , 2, 3 and 4. If you try to access an element with a key that do not exist you will get an OutOfBoundsException.