Where the documentation says "moving all the current values forward", while it sounds like the complexity would be O(N), I checked the code at https://github.com/php-ds/ext-ds/blob/master/src/ds/ds_deque.c#L366 and it is in fact O(1) for each element