xref: /PHP-8.2/ext/spl/tests/heap_005.phpt (revision a555cc0b)
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--EXPECT--
1999 => 1
2098 => 2
2197 => 3
2296 => 4
2395 => 5
2494 => 6
2593 => 7
2692 => 8
2791 => 9
2890 => 10
2989 => 11
3088 => 12
3187 => 13
3286 => 14
3385 => 15
3484 => 16
3583 => 17
3682 => 18
3781 => 19
3880 => 20
3979 => 21
4078 => 22
4177 => 23
4276 => 24
4375 => 25
4474 => 26
4573 => 27
4672 => 28
4771 => 29
4870 => 30
4969 => 31
5068 => 32
5167 => 33
5266 => 34
5365 => 35
5464 => 36
5563 => 37
5662 => 38
5761 => 39
5860 => 40
5959 => 41
6058 => 42
6157 => 43
6256 => 44
6355 => 45
6454 => 46
6553 => 47
6652 => 48
6751 => 49
6850 => 50
6949 => 51
7048 => 52
7147 => 53
7246 => 54
7345 => 55
7444 => 56
7543 => 57
7642 => 58
7741 => 59
7840 => 60
7939 => 61
8038 => 62
8137 => 63
8236 => 64
8335 => 65
8434 => 66
8533 => 67
8632 => 68
8731 => 69
8830 => 70
8929 => 71
9028 => 72
9127 => 73
9226 => 74
9325 => 75
9424 => 76
9523 => 77
9622 => 78
9721 => 79
9820 => 80
9919 => 81
10018 => 82
10117 => 83
10216 => 84
10315 => 85
10414 => 86
10513 => 87
10612 => 88
10711 => 89
10810 => 90
1099 => 91
1108 => 92
1117 => 93
1126 => 94
1135 => 95
1144 => 96
1153 => 97
1162 => 98
1171 => 99
1180 => 100
119