xref: /PHP-7.1/ext/spl/tests/bug62073.phpt (revision 9205c4fd)
1--TEST--
2Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys)
3--FILE--
4<?php
5$heap = new SplMaxHeap();
6$heap->insert(42);
7foreach ($heap as $key => $value) {
8    var_dump($key);
9    var_dump($value);
10    break;
11}
12
13$heap = new SplMaxHeap();
14$heap->insert(42);
15var_dump($heap->key());
16var_dump($heap->current());
17?>
18--EXPECT--
19int(0)
20int(42)
21int(0)
22int(42)
23