[IMP] Make compatible with php 5.4

@bwrsandman: actually, append / pop (without an index, iow popping from the end of a Python list) is very efficient in Python with a complexity ~O(1) (amortized for append()). insert() and pop from anywhere else than the end is O(n) and should be avoided.