Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 27 lines (27 sloc) 0.517 kb
4a56fdc Second commit
unknown authored
1 <?php
2 /**
b145c4b updated readme.md
ptrofimov authored
3 * Inline test example for bubble sort function
4 * @assert (array(2,1,3)) == array(1,2,3)
4a56fdc Second commit
unknown authored
5 */
6 function sort(array $arr) {
7 $size = sizeof($arr) - 1;
8 for ($i = $size; $i >= 0; $i--) {
99246e2 third commit
unknown authored
9 for ($j = 0; $j <= ($i - 1); $j++)
4a56fdc Second commit
unknown authored
10 if ($arr[$j] > $arr[$j + 1]) {
11 $k = $arr[$j];
12 $arr[$j] = $arr[$j + 1];
13 $arr[$j + 1] = $k;
14 }
15 }
16 return $arr;
b145c4b updated readme.md
ptrofimov authored
17 }
18 class A {
19 /**
20 * Inline test example
21 * for private class method
22 * @assert (2, 2) == 4
23 */
24 private function _add($a, $b) {
25 return $a + $b;
26 }
4a56fdc Second commit
unknown authored
27 }
Something went wrong with that request. Please try again.