Queue build on two stacks in PHP.