Stack implementation in PHP