Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 6fd4616c64
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (27 sloc) 0.517 kb
<?php
/**
* Inline test example for bubble sort function
* @assert (array(2,1,3)) == array(1,2,3)
*/
function sort(array $arr) {
$size = sizeof($arr) - 1;
for ($i = $size; $i >= 0; $i--) {
for ($j = 0; $j <= ($i - 1); $j++)
if ($arr[$j] > $arr[$j + 1]) {
$k = $arr[$j];
$arr[$j] = $arr[$j + 1];
$arr[$j + 1] = $k;
}
}
return $arr;
}
class A {
/**
* Inline test example
* for private class method
* @assert (2, 2) == 4
*/
private function _add($a, $b) {
return $a + $b;
}
}
Jump to Line
Something went wrong with that request. Please try again.