mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
122 lines
1.1 KiB
PHP
122 lines
1.1 KiB
PHP
--TEST--
|
|
SPL: SplMaxHeap: large unordered input iterated
|
|
--FILE--
|
|
<?php
|
|
$input = range(1,100);
|
|
shuffle($input);
|
|
|
|
$h = new SplMaxHeap();
|
|
|
|
foreach($input as $i) {
|
|
$h->insert($i);
|
|
}
|
|
|
|
foreach ($h as $k => $o) {
|
|
echo "$k => $o\n";
|
|
}
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECTF--
|
|
99 => 100
|
|
98 => 99
|
|
97 => 98
|
|
96 => 97
|
|
95 => 96
|
|
94 => 95
|
|
93 => 94
|
|
92 => 93
|
|
91 => 92
|
|
90 => 91
|
|
89 => 90
|
|
88 => 89
|
|
87 => 88
|
|
86 => 87
|
|
85 => 86
|
|
84 => 85
|
|
83 => 84
|
|
82 => 83
|
|
81 => 82
|
|
80 => 81
|
|
79 => 80
|
|
78 => 79
|
|
77 => 78
|
|
76 => 77
|
|
75 => 76
|
|
74 => 75
|
|
73 => 74
|
|
72 => 73
|
|
71 => 72
|
|
70 => 71
|
|
69 => 70
|
|
68 => 69
|
|
67 => 68
|
|
66 => 67
|
|
65 => 66
|
|
64 => 65
|
|
63 => 64
|
|
62 => 63
|
|
61 => 62
|
|
60 => 61
|
|
59 => 60
|
|
58 => 59
|
|
57 => 58
|
|
56 => 57
|
|
55 => 56
|
|
54 => 55
|
|
53 => 54
|
|
52 => 53
|
|
51 => 52
|
|
50 => 51
|
|
49 => 50
|
|
48 => 49
|
|
47 => 48
|
|
46 => 47
|
|
45 => 46
|
|
44 => 45
|
|
43 => 44
|
|
42 => 43
|
|
41 => 42
|
|
40 => 41
|
|
39 => 40
|
|
38 => 39
|
|
37 => 38
|
|
36 => 37
|
|
35 => 36
|
|
34 => 35
|
|
33 => 34
|
|
32 => 33
|
|
31 => 32
|
|
30 => 31
|
|
29 => 30
|
|
28 => 29
|
|
27 => 28
|
|
26 => 27
|
|
25 => 26
|
|
24 => 25
|
|
23 => 24
|
|
22 => 23
|
|
21 => 22
|
|
20 => 21
|
|
19 => 20
|
|
18 => 19
|
|
17 => 18
|
|
16 => 17
|
|
15 => 16
|
|
14 => 15
|
|
13 => 14
|
|
12 => 13
|
|
11 => 12
|
|
10 => 11
|
|
9 => 10
|
|
8 => 9
|
|
7 => 8
|
|
6 => 7
|
|
5 => 6
|
|
4 => 5
|
|
3 => 4
|
|
2 => 3
|
|
1 => 2
|
|
0 => 1
|
|
===DONE===
|