xref: /PHP-5.6/ext/spl/tests/heap_005.phpt (revision 9205c4fd)
1--TEST--
2SPL: SplMinHeap: large unordered input iterated
3--FILE--
4<?php
5$input = range(1,100);
6shuffle($input);
7
8$h = new SplMinHeap();
9
10foreach($input as $i) {
11    $h->insert($i);
12}
13
14foreach ($h as $k => $o) {
15    echo "$k => $o\n";
16}
17?>
18===DONE===
19<?php exit(0); ?>
20--EXPECTF--
2199 => 1
2298 => 2
2397 => 3
2496 => 4
2595 => 5
2694 => 6
2793 => 7
2892 => 8
2991 => 9
3090 => 10
3189 => 11
3288 => 12
3387 => 13
3486 => 14
3585 => 15
3684 => 16
3783 => 17
3882 => 18
3981 => 19
4080 => 20
4179 => 21
4278 => 22
4377 => 23
4476 => 24
4575 => 25
4674 => 26
4773 => 27
4872 => 28
4971 => 29
5070 => 30
5169 => 31
5268 => 32
5367 => 33
5466 => 34
5565 => 35
5664 => 36
5763 => 37
5862 => 38
5961 => 39
6060 => 40
6159 => 41
6258 => 42
6357 => 43
6456 => 44
6555 => 45
6654 => 46
6753 => 47
6852 => 48
6951 => 49
7050 => 50
7149 => 51
7248 => 52
7347 => 53
7446 => 54
7545 => 55
7644 => 56
7743 => 57
7842 => 58
7941 => 59
8040 => 60
8139 => 61
8238 => 62
8337 => 63
8436 => 64
8535 => 65
8634 => 66
8733 => 67
8832 => 68
8931 => 69
9030 => 70
9129 => 71
9228 => 72
9327 => 73
9426 => 74
9525 => 75
9624 => 76
9723 => 77
9822 => 78
9921 => 79
10020 => 80
10119 => 81
10218 => 82
10317 => 83
10416 => 84
10515 => 85
10614 => 86
10713 => 87
10812 => 88
10911 => 89
11010 => 90
1119 => 91
1128 => 92
1137 => 93
1146 => 94
1155 => 95
1164 => 96
1173 => 97
1182 => 98
1191 => 99
1200 => 100
121===DONE===
122