Updated Memoization PHP code example.