-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy patharrayiterator.uasort.html
More file actions
100 lines (79 loc) · 4.53 KB
/
Copy patharrayiterator.uasort.html
File metadata and controls
100 lines (79 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Sort with a user-defined comparison function and maintain index association</title>
<link media="all" rel="stylesheet" type="text/css" href="../../styles/theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="../../styles/theme-medium.css" />
</head>
<body class="docs"><div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<ul class="nav" style="width: 100%">
<li style="float: left;"><a href="arrayiterator.setflags.html">« ArrayIterator::setFlags</a></li>
<li style="float: right;"><a href="arrayiterator.uksort.html">ArrayIterator::uksort »</a></li>
</ul>
</div>
</div>
<div id="breadcrumbs" class="clearfix">
<ul class="breadcrumbs-container">
<li><a href="index.html">PHP Manual</a></li>
<li><a href="class.arrayiterator.html">ArrayIterator</a></li>
<li>Sort with a user-defined comparison function and maintain index association</li>
</ul>
</div>
<div id="layout">
<div id="layout-content"><div id="arrayiterator.uasort" class="refentry">
<div class="refnamediv">
<h1 class="refname">ArrayIterator::uasort</h1>
<p class="verinfo">(PHP 5 >= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">ArrayIterator::uasort</span> — <span class="dc-title">Sort with a user-defined comparison function and maintain index association</span></p>
</div>
<div class="refsect1 description" id="refsect1-arrayiterator.uasort-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="modifier">public</span> <span class="methodname"><strong>ArrayIterator::uasort</strong></span>
( <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$cmp_function</code></span>
) : <span class="type"><span class="type void">void</span></span></div>
<p class="para rdfs-comment">
This method sorts the elements such that indices maintain their correlation
with the values they are associated with, using a user-defined comparison
function.
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<p class="para">
If two members compare as equal, their relative order in the sorted array is undefined.
</p>
</p></blockquote>
</div>
<div class="refsect1 parameters" id="refsect1-arrayiterator.uasort-parameters">
<h3 class="title">Parameters</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">cmp_function</code></dt>
<dd>
<p class="para">
The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
</p>
<div class="methodsynopsis dc-description"><span class="methodname"><span class="replaceable">callback</span></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$a</code></span>, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$b</code></span> ) : <span class="type">int</span></div>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-arrayiterator.uasort-returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
No value is returned.
</p>
</div>
<div class="refsect1 seealso" id="refsect1-arrayiterator.uasort-seealso">
<h3 class="title">See Also</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="methodname"><a href="arrayiterator.asort.html" class="methodname" rel="rdfs-seeAlso">ArrayIterator::asort()</a> - Sort array by values</span></li>
<li class="member"><span class="methodname"><a href="arrayiterator.uksort.html" class="methodname" rel="rdfs-seeAlso">ArrayIterator::uksort()</a> - Sort by keys using a user-defined comparison function</span></li>
<li class="member"><span class="function"><a href="function.usort.html" class="function" rel="rdfs-seeAlso">usort()</a> - Sort an array by values using a user-defined comparison function</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>